diff options
author | Peng Wu <alexepico@gmail.com> | 2012-06-21 13:06:33 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2012-06-21 13:06:33 +0800 |
commit | 606b4b110302fad6590eca56cba7108681b8b434 (patch) | |
tree | f062b173011b21143538d7f12bc8f5710f695d97 /src/storage/chewing_large_table.cpp | |
parent | 9aa87d6bdadf9492a3c09d49841e23052c043d16 (diff) | |
download | libpinyin-606b4b110302fad6590eca56cba7108681b8b434.tar.gz libpinyin-606b4b110302fad6590eca56cba7108681b8b434.tar.xz libpinyin-606b4b110302fad6590eca56cba7108681b8b434.zip |
add ErrorResult
Diffstat (limited to 'src/storage/chewing_large_table.cpp')
-rw-r--r-- | src/storage/chewing_large_table.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/storage/chewing_large_table.cpp b/src/storage/chewing_large_table.cpp index cfcb987..9185976 100644 --- a/src/storage/chewing_large_table.cpp +++ b/src/storage/chewing_large_table.cpp @@ -484,7 +484,7 @@ int ChewingBitmapIndexLevel::remove_index(int phrase_length, if (length_array) return length_array->remove_index(phrase_length - 1, keys + 1, token); - return REMOVE_ITEM_DONOT_EXISTS; + return ERROR_REMOVE_ITEM_DONOT_EXISTS; } int ChewingLengthIndexLevel::add_index(int phrase_length, @@ -535,7 +535,7 @@ int ChewingLengthIndexLevel::remove_index(int phrase_length, assert(phrase_length + 1 < MAX_PHRASE_LENGTH); if (m_chewing_array_indexes->len <= phrase_length) - return REMOVE_ITEM_DONOT_EXISTS; + return ERROR_REMOVE_ITEM_DONOT_EXISTS; #define CASE(len) case len: \ { \ @@ -543,7 +543,7 @@ int ChewingLengthIndexLevel::remove_index(int phrase_length, (m_chewing_array_indexes, \ ChewingArrayIndexLevel<len> *, len); \ if (NULL == array) \ - return REMOVE_ITEM_DONOT_EXISTS; \ + return ERROR_REMOVE_ITEM_DONOT_EXISTS; \ return array->remove_index(keys, token); \ } @@ -588,14 +588,14 @@ int ChewingArrayIndexLevel<phrase_length>::add_index for (cur_elem = range.first; cur_elem != range.second; ++cur_elem) { if (cur_elem->m_token == token) - return INSERT_ITEM_EXISTS; + return ERROR_INSERT_ITEM_EXISTS; if (cur_elem->m_token > token) break; } int offset = (cur_elem - begin) * sizeof(IndexItem); m_chunk.insert_content(offset, &add_elem, sizeof(IndexItem)); - return INSERT_OK; + return ERROR_OK; } template<int phrase_length> @@ -619,11 +619,11 @@ int ChewingArrayIndexLevel<phrase_length>::remove_index } if (cur_elem == range.second) - return REMOVE_ITEM_DONOT_EXISTS; + return ERROR_REMOVE_ITEM_DONOT_EXISTS; int offset = (cur_elem - begin) * sizeof(IndexItem); m_chunk.remove_content(offset, sizeof(IndexItem)); - return REMOVE_OK; + return ERROR_OK; } |