am 19e13df9: Remove a duplicated method

# Via Ken Wakasa
* commit '19e13df91f36cf131f5139c44d7b80fc1e8f6f21':
  Remove a duplicated method
main
Ken Wakasa 2013-01-28 21:56:41 -08:00 committed by Android Git Automerger
commit 682c9fad1c
2 changed files with 2 additions and 17 deletions

View File

@ -21,6 +21,7 @@
#include "bigram_dictionary.h" #include "bigram_dictionary.h"
#include "binary_format.h" #include "binary_format.h"
#include "bloom_filter.h" #include "bloom_filter.h"
#include "char_utils.h"
#include "defines.h" #include "defines.h"
#include "dictionary.h" #include "dictionary.h"
@ -50,7 +51,7 @@ void BigramDictionary::addWordBigram(int *word, int length, int frequency, int *
int insertAt = 0; int insertAt = 0;
while (insertAt < MAX_RESULTS) { while (insertAt < MAX_RESULTS) {
if (frequency > bigramFreq[insertAt] || (bigramFreq[insertAt] == frequency if (frequency > bigramFreq[insertAt] || (bigramFreq[insertAt] == frequency
&& length < Dictionary::wideStrLen( && length < getCodePointCount(MAX_WORD_LENGTH,
bigramCodePoints + insertAt * MAX_WORD_LENGTH))) { bigramCodePoints + insertAt * MAX_WORD_LENGTH))) {
break; break;
} }

View File

@ -65,10 +65,6 @@ class Dictionary {
int getDictBufAdjust() const { return mDictBufAdjust; } int getDictBufAdjust() const { return mDictBufAdjust; }
virtual ~Dictionary(); virtual ~Dictionary();
// public static utility methods
// static inline methods should be defined in the header file
static int wideStrLen(int *str);
private: private:
DISALLOW_IMPLICIT_CONSTRUCTORS(Dictionary); DISALLOW_IMPLICIT_CONSTRUCTORS(Dictionary);
const uint8_t *mDict; const uint8_t *mDict;
@ -84,17 +80,5 @@ class Dictionary {
const BigramDictionary *mBigramDictionary; const BigramDictionary *mBigramDictionary;
SuggestInterface *mGestureSuggest; SuggestInterface *mGestureSuggest;
}; };
// public static utility methods
// static inline methods should be defined in the header file
inline int Dictionary::wideStrLen(int *str) {
if (!str) return 0;
int length = 0;
while (*str) {
str++;
length++;
}
return length;
}
} // namespace latinime } // namespace latinime
#endif // LATINIME_DICTIONARY_H #endif // LATINIME_DICTIONARY_H