am 3b530455: am 805ac949: Fix string.compare() logic. It happens to be working luckily.

* commit '3b53045515798648278f30cfd34869f243542bd3':
  Fix string.compare() logic.  It happens to be working luckily.
main
Ken Wakasa 2012-08-09 04:04:26 -07:00 committed by Android Git Automerger
commit 80b3795383
1 changed files with 3 additions and 6 deletions

View File

@ -40,8 +40,9 @@ class AdditionalProximityChars {
static const int32_t EN_US_ADDITIONAL_U[]; static const int32_t EN_US_ADDITIONAL_U[];
static bool isEnLocale(const std::string *locale_str) { static bool isEnLocale(const std::string *locale_str) {
return locale_str && locale_str->size() >= LOCALE_EN_US.size() const size_t LOCALE_EN_US_SIZE = LOCALE_EN_US.size();
&& LOCALE_EN_US.compare(0, LOCALE_EN_US.size(), *locale_str); return locale_str && locale_str->size() >= LOCALE_EN_US_SIZE
&& locale_str->compare(0, LOCALE_EN_US_SIZE, LOCALE_EN_US) == 0;
} }
public: public:
@ -84,10 +85,6 @@ class AdditionalProximityChars {
return 0; return 0;
} }
} }
static bool hasAdditionalChars(const std::string *locale_str, const int32_t c) {
return getAdditionalCharsSize(locale_str, c) > 0;
}
}; };
} // namespace latinime } // namespace latinime
#endif // LATINIME_ADDITIONAL_PROXIMITY_CHARS_H #endif // LATINIME_ADDITIONAL_PROXIMITY_CHARS_H