mirror of
https://github.com/openharmony/third_party_tex-hyphen.git
synced 2026-06-30 22:28:02 -04:00
!33 merge master into master
Fix method typo and use const reference in range-for loops
Created-by: KejiePeng
Commit-by: KejiePeng
Merged-by: openharmony_ci
Description: ### 一、内容说明(相关的Issue)
### 二、建议测试周期和提测地址
建议测试完成时间:xxxx.xx.xx
投产上线时间:xxxx.xx.xx
提测地址:CI环境/压测环境
测试账号:
### 三、变更内容
* 3.1 关联PR列表
* 3.2 数据库和部署说明
1. 常规更新
2. 重启unicorn
3. 重启sidekiq
4. 迁移任务:是否有迁移任务,没有写 "无"
5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无"
* 3.4 其他技术优化内容(做了什么,变更了什么)
- 重构了 xxxx 代码
- xxxx 算法优化
* 3.5 废弃通知(什么字段、方法弃用?)
* 3.6 后向不兼容变更(是否有无法向后兼容的变更?)
### 四、研发自测点(自测哪些?冒烟用例全部自测?)
自测测试结论:
### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方)
检查点:
| 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 |
|------|------------|----------|---------------|
| xxx | 否 | 需要 | 不需要 |
| | | | |
接口测试:
性能测试:
并发测试:
其他:
See merge request: openharmony/third_party_tex-hyphen!33
This commit is contained in:
@@ -51,7 +51,7 @@ std::vector<uint16_t> ConvertToUtf16(const std::string& utf8Str);
|
||||
|
||||
class HyphenProcessor {
|
||||
public:
|
||||
void Proccess(const std::string& filePath, const std::string& outFilePath) const;
|
||||
void Process(const std::string& filePath, const std::string& outFilePath) const;
|
||||
};
|
||||
|
||||
class HyphenReader {
|
||||
|
||||
@@ -173,7 +173,7 @@ struct Path {
|
||||
if (paths.size() == 0) {
|
||||
return;
|
||||
}
|
||||
for (auto path : paths) {
|
||||
for (const auto& path : paths) {
|
||||
path.second.Print(indent);
|
||||
}
|
||||
cout << endl;
|
||||
@@ -432,7 +432,7 @@ void processSection(const string& line, map<string, vector<string>>& sections, v
|
||||
static void ProcessContent(const string& line, vector<string>* current)
|
||||
{
|
||||
string pat;
|
||||
for (auto code : line) {
|
||||
for (const auto& code : line) {
|
||||
if (iswspace(code)) {
|
||||
if (!pat.empty()) {
|
||||
current->push_back(pat);
|
||||
@@ -504,7 +504,7 @@ static vector<uint16_t> ProcessWord(const string& wordString)
|
||||
auto word = ConvertToUtf16(wordString);
|
||||
vector<uint16_t> result;
|
||||
bool addedBreak = false;
|
||||
for (const auto code : word) {
|
||||
for (const auto& code : word) {
|
||||
if (code == '-') {
|
||||
result.push_back(BREAK_FLAG);
|
||||
addedBreak = true;
|
||||
@@ -608,7 +608,7 @@ void ResolveLeavesFromPatterns(const vector<vector<uint16_t>>& utf16Patterns, ma
|
||||
if (leaves[ix].patterns.find(codepoints) != leaves[ix].patterns.cend()) {
|
||||
cerr << "### Multiple definitions for pattern with size: " << codepoints.size() << endl;
|
||||
cerr << "###";
|
||||
for (auto codepoint : codepoints) {
|
||||
for (const auto& codepoint : codepoints) {
|
||||
cerr << " 0x" << hex << static_cast<int>(codepoint);
|
||||
}
|
||||
cerr << endl;
|
||||
@@ -662,7 +662,7 @@ static void BreakLeavesIntoPaths(map<uint16_t, PatternHolder>& leaves, CpRange&
|
||||
}
|
||||
|
||||
// collect some stats
|
||||
for (auto path : leave.second.paths) {
|
||||
for (const auto& path : leave.second.paths) {
|
||||
if (printCounts) {
|
||||
cout << "leafs-nodes: " << path.second.leafCount << " / " << path.second.count << endl;
|
||||
cout << "min-max: " << path.second.minimumCP << " / " << path.second.maximumCP << endl;
|
||||
@@ -719,8 +719,8 @@ static int32_t FormatOutFileHead(ofstream& out, const WriteOffestsParams& params
|
||||
|
||||
void ProcessUniqueRule(std::pair<const vector<uint8_t>, Rule>& uniqueRule)
|
||||
{
|
||||
for (auto ite : uniqueRule.second.patterns) {
|
||||
for (auto rule : ite.second) {
|
||||
for (const auto& ite : uniqueRule.second.patterns) {
|
||||
for (const auto& rule : ite.second) {
|
||||
if (!uniqueRule.second.uniqLeafs.count(*rule.cbegin())) {
|
||||
uniqueRule.second.uniqLeafs[*rule.cbegin()] = {0, 0};
|
||||
}
|
||||
@@ -806,8 +806,8 @@ static bool WriteLeavePathsToOutFile(map<uint16_t, PatternHolder>& leaves, const
|
||||
}
|
||||
}
|
||||
|
||||
// write distinc code points array after the direct ones
|
||||
for (auto path : bigOnes) {
|
||||
// write distinct code points array after the direct ones
|
||||
for (const auto path : bigOnes) {
|
||||
uint32_t end{0};
|
||||
uint16_t value = path->Write(out, tableOffset, &end);
|
||||
uint16_t offset = value & 0x3fff;
|
||||
@@ -930,7 +930,7 @@ void CreateDirectory(const std::string& folderPath)
|
||||
}
|
||||
}
|
||||
|
||||
void HyphenProcessor::Proccess(const std::string& filePath, const std::string& outFilePath) const
|
||||
void HyphenProcessor::Process(const std::string& filePath, const std::string& outFilePath) const
|
||||
{
|
||||
map<string, vector<string>> sections;
|
||||
if (ResolveSectionsFromFile(filePath, sections) != SUCCEED) {
|
||||
@@ -996,7 +996,7 @@ int main(int argc, char** argv)
|
||||
string outFilePath = argv[2];
|
||||
|
||||
OHOS::Hyphenate::HyphenProcessor hyphenProcessor;
|
||||
hyphenProcessor.Proccess(filePath, outFilePath);
|
||||
hyphenProcessor.Process(filePath, outFilePath);
|
||||
|
||||
return SUCCEED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user