summaryrefslogtreecommitdiffstats
path: root/tests/storage/test_chewing_table.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/storage/test_chewing_table.cpp')
-rw-r--r--tests/storage/test_chewing_table.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/storage/test_chewing_table.cpp b/tests/storage/test_chewing_table.cpp
index a826f46..e1189b5 100644
--- a/tests/storage/test_chewing_table.cpp
+++ b/tests/storage/test_chewing_table.cpp
@@ -63,9 +63,13 @@ int main(int argc, char * argv[]) {
for (size_t i = 0; i < bench_times; ++i) {
largetable.search(keys->len, (ChewingKey *)keys->data, ranges);
- }
- phrase_index.clear_ranges(ranges);
+ /* clear ranges. */
+ for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) {
+ if (ranges[i])
+ g_array_set_size(ranges[i], 0);
+ }
+ }
print_time(start, bench_times);