diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-03-28 15:18:15 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-03-28 15:18:15 +0100 |
| commit | 94f4531bc8cd7f4fc94df823ef6f6d398bf113a7 (patch) | |
| tree | a5842479f4e4ec178cad8410afdf30fca0bc4692 /src/ranked_match.cc | |
| parent | 2a9875bd58b4588c914942a909db62c3bf086a2d (diff) | |
Tweak subsequence_match_smart_case
Diffstat (limited to 'src/ranked_match.cc')
| -rw-r--r-- | src/ranked_match.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ranked_match.cc b/src/ranked_match.cc index 8d453937..4996dddd 100644 --- a/src/ranked_match.cc +++ b/src/ranked_match.cc @@ -75,12 +75,11 @@ static bool subsequence_match_smart_case(StringView str, StringView subseq, int& index_sum = 0; auto it = str.begin(); int index = 0; - for (auto subseq_it = subseq.begin(); subseq_it != subseq.end(); - subseq_it = utf8::next(subseq_it, subseq.end())) + for (auto subseq_it = subseq.begin(); subseq_it != subseq.end();) { if (it == str.end()) return false; - const Codepoint c = utf8::codepoint(subseq_it, subseq.end()); + const Codepoint c = utf8::read_codepoint(subseq_it, subseq.end()); while (not smartcase_eq(c, utf8::read_codepoint(it, subseq.end()))) { ++index; |
