diff options
Diffstat (limited to 'src/storage/facade_phrase_table.h')
-rw-r--r-- | src/storage/facade_phrase_table.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/storage/facade_phrase_table.h b/src/storage/facade_phrase_table.h index d3acde3..ee2ff0f 100644 --- a/src/storage/facade_phrase_table.h +++ b/src/storage/facade_phrase_table.h @@ -116,14 +116,15 @@ public: * @phrase_length: the length of the phrase to be added. * @phrase: the ucs4 characters of the phrase to be added. * @token: the token of the phrase to be added. - * @returns: the add result of enum AddIndexResult. + * @returns: the add result of enum ErrorResult. * * Add the phrase token to the user phrase table. * */ int add_index(int phrase_length, /* in */ ucs4_t phrase[], /* in */ phrase_token_t token) { - assert(NULL != m_user_phrase_table); + if (NULL == m_user_phrase_table) + return false; return m_user_phrase_table->add_index (phrase_length, phrase, token); } @@ -133,14 +134,15 @@ public: * @phrase_length: the length of the phrase to be removed. * @phrase: the ucs4 characters of the phrase to be removed. * @token: the token of the phrase to be removed. - * @returns: the remove result of enum RemoveIndexResult. + * @returns: the remove result of enum ErrorResult. * * Remove the phrase token from the user phrase table. * */ int remove_index(int phrase_length, /* in */ ucs4_t phrase[], /* out */ phrase_token_t & token){ - assert(NULL != m_user_phrase_table); + if (NULL == m_user_phrase_table) + return false; return m_user_phrase_table->remove_index (phrase_length, phrase, token); } |