From 967e2d308d6e3cf86257e7034e9067b0aee9b705 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Wed, 8 Jun 2016 16:50:30 +0800 Subject: fixes a typo --- src/pinyin.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/pinyin.cpp b/src/pinyin.cpp index a79bc2b..9541153 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -1752,18 +1752,16 @@ bool pinyin_guess_candidates(pinyin_instance_t * instance, to avoid duplicates of candidates. */ ++end; for (; end < matrix.size(); ++end) { - const size_t size = matrix.get_column_size(end); + const size_t index = end - 1; + const size_t size = matrix.get_column_size(index); /* assume only one zero ChewingKey "'" here, but no check. */ if (1 != size) break; - matrix.get_item(end, 0, key, key_rest); + matrix.get_item(index, 0, key, key_rest); - if (zero_key != key) { - /* non-zero ChewingKey has at least length of one. */ - ++end; + if (zero_key != key) break; - } } } -- cgit