diff options
author | Peng Wu <alexepico@gmail.com> | 2012-05-16 14:58:06 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2012-05-16 14:58:06 +0800 |
commit | 1d317350af0202b4d32ae9417de2adf7817ad107 (patch) | |
tree | b219a7acdd5f555d5d4868d49ed2833866f7f2f9 /src/storage | |
parent | 91109001e08ce8cd2748692eb8a031ef7e763896 (diff) | |
download | libpinyin-1d317350af0202b4d32ae9417de2adf7817ad107.tar.gz libpinyin-1d317350af0202b4d32ae9417de2adf7817ad107.tar.xz libpinyin-1d317350af0202b4d32ae9417de2adf7817ad107.zip |
improves FacadePhraseIndex
Diffstat (limited to 'src/storage')
-rw-r--r-- | src/storage/phrase_index.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/storage/phrase_index.h b/src/storage/phrase_index.h index 45194eb..cedcdc1 100644 --- a/src/storage/phrase_index.h +++ b/src/storage/phrase_index.h @@ -426,7 +426,6 @@ public: * */ class FacadePhraseIndex{ - friend class PinyinLookup; private: guint32 m_total_freq; SubPhraseIndex * m_sub_phrase_indices[PHRASE_INDEX_LIBRARY_COUNT]; @@ -659,10 +658,13 @@ public: * */ bool prepare_ranges(PhraseIndexRanges ranges) { + /* assume memset(ranges, 0, sizeof(ranges)); */ for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) { + GArray * & range = ranges[i]; + assert(NULL == range); + SubPhraseIndex * sub_phrase = m_sub_phrase_indices[i]; if (sub_phrase) { - GArray * & range = ranges[i]; range = g_array_new(FALSE, FALSE, sizeof(PhraseIndexRange)); } } |