From 18e2714d4c67d55d9c054f8087b297e7862b433f Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 9 Jan 2012 13:12:53 +0800 Subject: fixes facade_*_table.h --- src/storage/facade_chewing_table.h | 7 +++++++ src/storage/facade_phrase_table.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/storage/facade_chewing_table.h b/src/storage/facade_chewing_table.h index e411589..34bf55b 100644 --- a/src/storage/facade_chewing_table.h +++ b/src/storage/facade_chewing_table.h @@ -67,6 +67,13 @@ public: /* search method */ int search(int phrase_length, /* in */ ChewingKey keys[], /* out */ PhraseIndexRanges ranges) const { + + /* clear ranges. */ + for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) { + if (ranges[i]) + g_array_set_size(ranges[i], 0); + } + int result = SEARCH_NONE; if (NULL != m_system_chewing_table) diff --git a/src/storage/facade_phrase_table.h b/src/storage/facade_phrase_table.h index 913a611..fadf03f 100644 --- a/src/storage/facade_phrase_table.h +++ b/src/storage/facade_phrase_table.h @@ -61,6 +61,7 @@ public: int search(int phrase_length, /* in */ utf16_t phrase[], /* out */ phrase_token_t & token){ int result = SEARCH_NONE; + token = null_token; if (NULL != m_system_phrase_table) result |= m_system_phrase_table->search -- cgit