Cosmetic fixes and a bug fix in UnigramDictionary::testCharGroupForContinuedLikeness().
This change has actually been extracted from a change work in progress I4fe423834b8131fb122251892c98228a6e08ba25
Change-Id: I52568fa09da2ea22be7f8bfe9676b7cd73c31fa4
diff --git a/native/jni/src/dictionary.h b/native/jni/src/dictionary.h
index e9a03ce..a135889 100644
--- a/native/jni/src/dictionary.h
+++ b/native/jni/src/dictionary.h
@@ -90,11 +90,12 @@
// static inline methods should be defined in the header file
inline int Dictionary::wideStrLen(unsigned short *str) {
if (!str) return 0;
- unsigned short *end = str;
- while (*end) {
- end++;
+ int length = 0;
+ while (*str) {
+ str++;
+ length++;
}
- return end - str;
+ return length;
}
} // namespace latinime
#endif // LATINIME_DICTIONARY_H