summaryrefslogtreecommitdiffstats
path: root/icu/src/main/native/NativeConverter.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2010-04-23 16:15:38 -0700
committerElliott Hughes <enh@google.com>2010-04-23 16:22:02 -0700
commit0808cae1a2616ba9c708c7cc4489723b4060178e (patch)
tree60592ac09b18dcaec2de2b7a1418adae186437d8 /icu/src/main/native/NativeConverter.cpp
parentd5fa369bd73d4098c59b3d9949a67f89910e71f1 (diff)
downloadlibcore-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/NativeConverter.cpp')
-rw-r--r--icu/src/main/native/NativeConverter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/icu/src/main/native/NativeConverter.cpp b/icu/src/main/native/NativeConverter.cpp
index 3f5a186..8b3952e 100644
--- a/icu/src/main/native/NativeConverter.cpp
+++ b/icu/src/main/native/NativeConverter.cpp
@@ -39,11 +39,11 @@ static void JNI_TO_U_CALLBACK_SUBSTITUTE
static jlong openConverter(JNIEnv* env, jclass, jstring converterName) {
ScopedUtfChars converterNameChars(env, converterName);
- if (!converterNameChars.data()) {
+ if (!converterNameChars.c_str()) {
return 0;
}
UErrorCode errorCode = U_ZERO_ERROR;
- UConverter* conv = ucnv_open(converterNameChars.data(), &errorCode);
+ UConverter* conv = ucnv_open(converterNameChars.c_str(), &errorCode);
icu4jni_error(env, errorCode);
return (jlong) conv;
}
@@ -945,11 +945,11 @@ static jboolean contains(JNIEnv* env, jclass, jlong handle1, jlong handle2) {
static jobject charsetForName(JNIEnv* env, jclass, jstring charsetName) {
ScopedUtfChars charsetNameChars(env, charsetName);
- if (!charsetNameChars.data()) {
+ if (!charsetNameChars.c_str()) {
return NULL;
}
// Get ICU's canonical name for this charset.
- const char* icuCanonicalName = getICUCanonicalName(charsetNameChars.data());
+ const char* icuCanonicalName = getICUCanonicalName(charsetNameChars.c_str());
if (icuCanonicalName == NULL) {
return NULL;
}