From: Peng Wu Date: Tue, 22 Nov 2011 09:05:17 +0000 (+0800) Subject: improves full pinyin parse_one_key X-Git-Tag: 0.4.91~132 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c1b832d3823d82afafd449466a5e8b0d0bb9396;p=platform%2Fupstream%2Flibpinyin.git improves full pinyin parse_one_key --- 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. */