summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/storage/chewing_large_table2.h7
-rw-r--r--src/storage/phrase_large_table3.cpp2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/storage/chewing_large_table2.h b/src/storage/chewing_large_table2.h
index e9a64bd..9a20a2b 100644
--- a/src/storage/chewing_large_table2.h
+++ b/src/storage/chewing_large_table2.h
@@ -172,7 +172,12 @@ public:
}
/* get length method */
- int get_length() const;
+ int get_length() const {
+ const IndexItem * begin = (IndexItem *) m_chunk.begin();
+ const IndexItem * end = (IndexItem *) m_chunk.end();
+
+ return end - begin;
+ }
/* mask out method */
bool mask_out(phrase_token_t mask, phrase_token_t value);
diff --git a/src/storage/phrase_large_table3.cpp b/src/storage/phrase_large_table3.cpp
index f1ae3e9..a769d0b 100644
--- a/src/storage/phrase_large_table3.cpp
+++ b/src/storage/phrase_large_table3.cpp
@@ -94,7 +94,7 @@ int PhraseTableEntry::get_length() const {
const phrase_token_t * begin = (phrase_token_t *) m_chunk.begin();
const phrase_token_t * end = (phrase_token_t *) m_chunk.end();
- return begin - end;
+ return end - begin;
}
/* mask out method */