summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/storage/facade_phrase_table2.h2
-rw-r--r--tests/storage/test_phrase_table.cpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/storage/facade_phrase_table2.h b/src/storage/facade_phrase_table2.h
index a6e8bdc..3f40f57 100644
--- a/src/storage/facade_phrase_table2.h
+++ b/src/storage/facade_phrase_table2.h
@@ -98,7 +98,7 @@ public:
*/
int search(int phrase_length, /* in */ ucs4_t phrase[],
/* out */ PhraseTokens tokens) const {
- /* clear ranges. */
+ /* clear tokens. */
for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) {
if (tokens[i])
g_array_set_size(tokens[i], 0);
diff --git a/tests/storage/test_phrase_table.cpp b/tests/storage/test_phrase_table.cpp
index 3c4c489..968a9f8 100644
--- a/tests/storage/test_phrase_table.cpp
+++ b/tests/storage/test_phrase_table.cpp
@@ -34,6 +34,12 @@ int main(int argc, char * argv[]){
guint32 start = record_time();
for ( size_t i = 0; i < bench_times; ++i){
largetable.search(phrase_len, new_phrase, tokens);
+
+ /* clear tokens. */
+ for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) {
+ if (tokens[i])
+ g_array_set_size(tokens[i], 0);
+ }
}
print_time(start, bench_times);