From cc58d4f858887a49fa19a37b5c1b4e199295e999 Mon Sep 17 00:00:00 2001 From: yanyiwu Date: Sat, 21 Sep 2024 21:29:55 +0800 Subject: [PATCH] DictTrie: removed unused var --- include/cppjieba/DictTrie.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/cppjieba/DictTrie.hpp b/include/cppjieba/DictTrie.hpp index 7aae3f0c..f5c71902 100644 --- a/include/cppjieba/DictTrie.hpp +++ b/include/cppjieba/DictTrie.hpp @@ -149,13 +149,12 @@ class DictTrie { void LoadUserDict(const string& filePaths) { vector files = limonp::Split(filePaths, "|;"); - size_t lineno = 0; for (size_t i = 0; i < files.size(); i++) { ifstream ifs(files[i].c_str()); XCHECK(ifs.is_open()) << "open " << files[i] << " failed"; string line; - for (; getline(ifs, line); lineno++) { + while(getline(ifs, line)) { if (line.size() == 0) { continue; } @@ -214,7 +213,7 @@ class DictTrie { vector buf; DictUnit node_info; - for (size_t lineno = 0; getline(ifs, line); lineno++) { + while (getline(ifs, line)) { Split(line, buf, " "); XCHECK(buf.size() == DICT_COLUMN_NUM) << "split result illegal, line:" << line; MakeNodeInfo(node_info,