summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/storage/phrase_index.h17
1 files changed, 17 insertions, 0 deletions
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
@@ -670,6 +670,23 @@ 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 * onerange = ranges[i];
+ if (onerange) {
+ g_array_set_size(onerange, 0);
+ }
+ }
+ }
+
+ /**
* FacadePhraseIndex::destroy_ranges:
* @ranges: the ranges to be destroyed.
* @returns: whether the destroy operation is successful.