summaryrefslogtreecommitdiff
path: root/src/java_lang_reflect_Array.cc
diff options
context:
space:
mode:
author Elliott Hughes <enh@google.com> 2011-12-15 20:56:48 -0800
committer Elliott Hughes <enh@google.com> 2011-12-16 14:17:50 -0800
commitc3b77c7c2971124cbf3b2d9da64e7a8a9a649f2e (patch)
treeb8f2b70fb281d2d8b617491755bcdb7f798af837 /src/java_lang_reflect_Array.cc
parent90040194a1b5c441dde5c8a8b6d637c23972e0f3 (diff)
Avoid copying and strlen(3) in the FindClass path.
Change-Id: I789f3c883596d1852a2c1954ce7a207e6f937117
Diffstat (limited to 'src/java_lang_reflect_Array.cc')
-rw-r--r--src/java_lang_reflect_Array.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/java_lang_reflect_Array.cc b/src/java_lang_reflect_Array.cc
index 1d8b526f6d..3bf26808de 100644
--- a/src/java_lang_reflect_Array.cc
+++ b/src/java_lang_reflect_Array.cc
@@ -46,7 +46,7 @@ Array* CreateMultiArray(Class* array_class, int current_dimension, IntArray* dim
}
std::string sub_array_descriptor(ClassHelper(array_class).GetDescriptor() + 1);
ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
- Class* sub_array_class = class_linker->FindClass(sub_array_descriptor,
+ Class* sub_array_class = class_linker->FindClass(sub_array_descriptor.c_str(),
array_class->GetClassLoader());
if (sub_array_class == NULL) {
CHECK(Thread::Current()->IsExceptionPending());
@@ -106,7 +106,7 @@ jobject Array_createMultiArray(JNIEnv* env, jclass, jclass javaElementClass, job
// Find/generate the array class.
ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
- Class* array_class = class_linker->FindClass(descriptor, element_class->GetClassLoader());
+ Class* array_class = class_linker->FindClass(descriptor.c_str(), element_class->GetClassLoader());
if (array_class == NULL) {
CHECK(Thread::Current()->IsExceptionPending());
return NULL;
@@ -134,7 +134,7 @@ jobject Array_createObjectArray(JNIEnv* env, jclass, jclass javaElementClass, ji
descriptor += ClassHelper(element_class).GetDescriptor();
ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
- Class* array_class = class_linker->FindClass(descriptor, element_class->GetClassLoader());
+ Class* array_class = class_linker->FindClass(descriptor.c_str(), element_class->GetClassLoader());
if (array_class == NULL) {
CHECK(Thread::Current()->IsExceptionPending());
return NULL;