Skip to content

Commit

Permalink
fix: iterator is not pointer (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj authored Jan 17, 2025
1 parent d5a2823 commit 9452eb3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libime/table/tablebaseddictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ TableBasedDictionaryPrivate::parseDataLine(std::string_view buf, bool user) {
}

uint32_t firstChar;
const auto *next =
std::string_view::iterator next =
fcitx::utf8::getNextChar(key.begin(), key.end(), &firstChar);
auto *iter = std::find(std::begin(special), std::end(special), firstChar);
PhraseFlag flag = user ? PhraseFlag::User : PhraseFlag::None;
Expand Down Expand Up @@ -1328,7 +1328,7 @@ bool TableBasedDictionary::generateWithHint(
index = valueLen - ruleEntry.character();
}
iter = fcitx::utf8::nextNChar(value.begin(), index);
const auto *prev = iter;
std::string_view::iterator prev = iter;
iter = fcitx::utf8::nextChar(iter);
std::string_view chr(&*prev, std::distance(prev, iter));

Expand Down Expand Up @@ -1386,8 +1386,8 @@ bool TableBasedDictionary::isInputCode(uint32_t c) const {
}

bool TableBasedDictionary::isAllInputCode(std::string_view code) const {
const auto *iter = code.begin();
const auto *end = code.end();
std::string_view::iterator iter = code.begin();
std::string_view::iterator end = code.end();
while (iter != end) {
uint32_t chr;
iter = fcitx::utf8::getNextChar(iter, end, &chr);
Expand Down

0 comments on commit 9452eb3

Please sign in to comment.