From 0808cae1a2616ba9c708c7cc4489723b4060178e Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 23 Apr 2010 16:15:38 -0700 Subject: Dead code/cruft removal in the collation code. I've also renamed ScopedUtfChars::data to ScopedUtfChars::c_str, by analogy with std::string (since this method has always been more like c_str than data). This also fixes a few leaks on error paths. The old code used to go all the way into native code to return a constant hash code of 1, so I've removed all that and switched to the idiomatic bogo hash code (with the idiomatic comment). Change-Id: I25da8c422155860b5ab348786d369c6c7598135c --- icu/src/main/native/ICU.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'icu/src/main/native/ICU.cpp') diff --git a/icu/src/main/native/ICU.cpp b/icu/src/main/native/ICU.cpp index 1517932..4f08513 100644 --- a/icu/src/main/native/ICU.cpp +++ b/icu/src/main/native/ICU.cpp @@ -70,7 +70,7 @@ private: }; static Locale getLocale(JNIEnv* env, jstring localeName) { - return Locale::createFromName(ScopedUtfChars(env, localeName).data()); + return Locale::createFromName(ScopedUtfChars(env, localeName).c_str()); } static jint getCurrencyFractionDigitsNative(JNIEnv* env, jclass, jstring currencyCode) { @@ -528,7 +528,7 @@ static jstring getIntCurrencyCode(JNIEnv* env, jstring locale) { ScopedUtfChars localeChars(env, locale); // Extract the 2-character country name. - if (strlen(localeChars.data()) < 5) { + if (strlen(localeChars.c_str()) < 5) { return NULL; } if (localeChars[3] < 'A' || localeChars[3] > 'Z' || localeChars[4] < 'A' || localeChars[4] > 'Z') { -- cgit v1.1