summaryrefslogtreecommitdiffstats
path: root/src/lookup/pinyin_lookup2.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-09-19 10:47:16 +0800
committerPeng Wu <alexepico@gmail.com>2012-09-19 10:47:16 +0800
commitb449a30c6e3a9138c0d6fd32b9b6545e4fc79cac (patch)
tree90ee52369108a2e8b1cce77557048008ddc9b7f9 /src/lookup/pinyin_lookup2.cpp
parent7012134ed81f050c4f45f043a346818c76bf0fc7 (diff)
downloadlibpinyin-b449a30c6e3a9138c0d6fd32b9b6545e4fc79cac.tar.gz
libpinyin-b449a30c6e3a9138c0d6fd32b9b6545e4fc79cac.tar.xz
libpinyin-b449a30c6e3a9138c0d6fd32b9b6545e4fc79cac.zip
minor fix
Diffstat (limited to 'src/lookup/pinyin_lookup2.cpp')
-rw-r--r--src/lookup/pinyin_lookup2.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lookup/pinyin_lookup2.cpp b/src/lookup/pinyin_lookup2.cpp
index c6686e0..45a9e97 100644
--- a/src/lookup/pinyin_lookup2.cpp
+++ b/src/lookup/pinyin_lookup2.cpp
@@ -282,6 +282,9 @@ bool PinyinLookup2::get_best_match(TokenVector prefixes,
bool PinyinLookup2::search_unigram2(GPtrArray * topresults, int nstep,
PhraseIndexRanges ranges) {
+ if (0 == topresults->len)
+ return false;
+
lookup_value_t * max = (lookup_value_t *)
g_ptr_array_index(topresults, 0);