drop FacadePhraseIndex::clear_ranges method
authorPeng Wu <alexepico@gmail.com>
Fri, 31 Aug 2012 07:00:06 +0000 (15:00 +0800)
committerPeng Wu <alexepico@gmail.com>
Fri, 31 Aug 2012 07:01:44 +0000 (15:01 +0800)
src/storage/phrase_index.h
tests/storage/test_chewing_table.cpp

index 93704d6..d59865d 100644 (file)
@@ -672,24 +672,6 @@ public:
     }
 
     /**
-     * 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.
      * @returns: whether the destroy operation is successful.
index a826f46..e1189b5 100644 (file)
@@ -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);