diff options
author | Elliott Hughes <enh@google.com> | 2010-04-23 16:15:38 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2010-04-23 16:22:02 -0700 |
commit | 0808cae1a2616ba9c708c7cc4489723b4060178e (patch) | |
tree | 60592ac09b18dcaec2de2b7a1418adae186437d8 /icu/src/main/native/UCharacter.cpp | |
parent | d5fa369bd73d4098c59b3d9949a67f89910e71f1 (diff) | |
download | libcore-0808cae1a2616ba9c708c7cc4489723b4060178e.zip libcore-0808cae1a2616ba9c708c7cc4489723b4060178e.tar.gz libcore-0808cae1a2616ba9c708c7cc4489723b4060178e.tar.bz2 |
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
Diffstat (limited to 'icu/src/main/native/UCharacter.cpp')
-rw-r--r-- | icu/src/main/native/UCharacter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/icu/src/main/native/UCharacter.cpp b/icu/src/main/native/UCharacter.cpp index 1c5af48..abad16a 100644 --- a/icu/src/main/native/UCharacter.cpp +++ b/icu/src/main/native/UCharacter.cpp @@ -136,7 +136,7 @@ static jstring toLowerCaseStringImpl(JNIEnv* env, jclass, jstring javaString, js ScopedJavaUnicodeString scopedString(env, javaString); UnicodeString& s(scopedString.unicodeString()); UnicodeString original(s); - s.toLower(Locale::createFromName(ScopedUtfChars(env, localeName).data())); + s.toLower(Locale::createFromName(ScopedUtfChars(env, localeName).c_str())); return s == original ? javaString : env->NewString(s.getBuffer(), s.length()); } @@ -144,7 +144,7 @@ static jstring toUpperCaseStringImpl(JNIEnv* env, jclass, jstring javaString, js ScopedJavaUnicodeString scopedString(env, javaString); UnicodeString& s(scopedString.unicodeString()); UnicodeString original(s); - s.toUpper(Locale::createFromName(ScopedUtfChars(env, localeName).data())); + s.toUpper(Locale::createFromName(ScopedUtfChars(env, localeName).c_str())); return s == original ? javaString : env->NewString(s.getBuffer(), s.length()); } |