From 2c1b832d3823d82afafd449466a5e8b0d0bb9396 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Tue, 22 Nov 2011 17:05:17 +0800 Subject: improves full pinyin parse_one_key --- src/storage/pinyin_parser2.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/storage/pinyin_parser2.cpp') diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp index 9c5876c..3f3b5d9 100644 --- a/src/storage/pinyin_parser2.cpp +++ b/src/storage/pinyin_parser2.cpp @@ -177,11 +177,9 @@ bool FullPinyinParser2::parse_one_key (guint32 options, ChewingKey & key, /* parse pinyin core staff here. */ /* Note: optimize here? */ - for (; parsed_len >= len - 1; --parsed_len) { - input[parsed_len] = '\0'; - if (search_pinyin_index(options, input, key, key_rest)) - break; - } + input[parsed_len] = '\0'; + if (!search_pinyin_index(options, input, key, key_rest)) + --parsed_len; if (options & USE_TONE) { /* post processing tone. */ -- cgit