From 160a73b0d0efae72d2b6232e393897e3aa075811 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Wed, 16 May 2012 14:14:39 +0800 Subject: write FacadePhraseIndex::clear_ranges --- src/storage/phrase_index.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/storage/phrase_index.h b/src/storage/phrase_index.h index d7b8747..7e7739e 100644 --- a/src/storage/phrase_index.h +++ b/src/storage/phrase_index.h @@ -669,6 +669,23 @@ 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 * onerange = ranges[i]; + if (onerange) { + g_array_set_size(onerange, 0); + } + } + } + /** * FacadePhraseIndex::destroy_ranges: * @ranges: the ranges to be destroyed. -- cgit