guint32 start = record_time();
PhraseIndexRanges ranges;
- for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) {
+ memset(ranges, 0, sizeof(PhraseIndexRanges));
+
+ guint8 min_index, max_index;
+ phrase_index.get_sub_phrase_range(min_index, max_index);
+
+ for (size_t i = min_index; i < max_index; ++i) {
ranges[i] = g_array_new(FALSE, FALSE, sizeof(PhraseIndexRange));
}
largetable.search(keys->len, (ChewingKey *)keys->data, ranges);
}
- for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) {
+ for (size_t i = min_index; i < max_index; ++i) {
g_array_set_size(ranges[i], 0);
}
print_time(start, bench_times);