summaryrefslogtreecommitdiffstats
path: root/src/zhuyin.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2017-05-27 14:00:13 +0800
committerPeng Wu <alexepico@gmail.com>2017-05-27 14:00:13 +0800
commitd70f442d2e645dce99970d3afd903ddf1edb2bff (patch)
tree30adf8db52228501fb9fb399ef54e9955518f60f /src/zhuyin.cpp
parentfea30d2bd41f7b85e2e7014e065dd30ee67b5da9 (diff)
downloadlibpinyin-d70f442d2e645dce99970d3afd903ddf1edb2bff.tar.gz
libpinyin-d70f442d2e645dce99970d3afd903ddf1edb2bff.tar.xz
libpinyin-d70f442d2e645dce99970d3afd903ddf1edb2bff.zip
fixes a bug
Diffstat (limited to 'src/zhuyin.cpp')
-rw-r--r--src/zhuyin.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/zhuyin.cpp b/src/zhuyin.cpp
index 531fb86..f4e28d8 100644
--- a/src/zhuyin.cpp
+++ b/src/zhuyin.cpp
@@ -1494,16 +1494,14 @@ bool zhuyin_guess_candidates_after_cursor(zhuyin_instance_t * instance,
/* matrix reserved one extra slot. */
const size_t start = offset;
- for (size_t end = start + 1; end < matrix.size();) {
+ for (size_t end = start + 1; end < matrix.size(); ++end) {
/* do pinyin search. */
context->m_phrase_index->clear_ranges(ranges);
int retval = search_matrix(context->m_pinyin_table, &matrix,
start, end, ranges);
- if ( !(retval & SEARCH_OK) ) {
- ++end;
+ if ( !(retval & SEARCH_OK) )
continue;
- }
lookup_candidate_t template_item;
template_item.m_begin = start; template_item.m_end = end;