From 94f4531bc8cd7f4fc94df823ef6f6d398bf113a7 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 28 Mar 2016 15:18:15 +0100 Subject: [PATCH] Tweak subsequence_match_smart_case --- src/ranked_match.cc | 5 ++--- 1 file 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;