From 3647a6691f643b6a820518e5021e03baed332da4 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Fri, 12 Aug 2016 13:02:50 +0800 Subject: fixes pinyin_get_character_offset function --- src/pinyin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pinyin.cpp b/src/pinyin.cpp index 6d8738c..29c4c8c 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -2488,9 +2488,6 @@ static bool _get_char_offset_recur(pinyin_instance_t * instance, const size_t newstart = key_rest.m_raw_end; - if (newstart > offset) - return true; - const ChewingKey zero_key; if (zero_key == key) { /* assume only one key here for "'" or the last key. */ @@ -2508,6 +2505,9 @@ static bool _get_char_offset_recur(pinyin_instance_t * instance, if (pinyin_poss < FLT_EPSILON) continue; + if (newstart > offset) + return true; + ++length; result = _get_char_offset_recur -- cgit