From ea1c8d88ee73d012bb128122d4dc012921df49b6 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Fri, 31 Aug 2012 15:00:06 +0800 Subject: drop FacadePhraseIndex::clear_ranges method --- src/storage/phrase_index.h | 18 ------------------ tests/storage/test_chewing_table.cpp | 8 ++++++-- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/storage/phrase_index.h b/src/storage/phrase_index.h index 93704d6..d59865d 100644 --- a/src/storage/phrase_index.h +++ b/src/storage/phrase_index.h @@ -671,24 +671,6 @@ public: return true; } - /** - * FacadePhraseIndex::clear_ranges: - * @ranges: the ranges to be cleared. - * @returns: whether the clear operation is successful. - * - * Clear the ranges. - * - */ - bool clear_ranges(PhraseIndexRanges ranges) { - for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) { - GArray * range = ranges[i]; - if (range) { - g_array_set_size(range, 0); - } - } - return true; - } - /** * FacadePhraseIndex::destroy_ranges: * @ranges: the ranges to be destroyed. 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); -- cgit