Avoid copying and strlen(3) in the FindClass path.
Change-Id: I789f3c883596d1852a2c1954ce7a207e6f937117
diff --git a/src/object.cc b/src/object.cc
index 10d4289..b98235b 100644
--- a/src/object.cc
+++ b/src/object.cc
@@ -307,15 +307,15 @@
++p; // Either the ';' or the primitive type.
std::string descriptor(start, (p - start));
- return class_linker->FindClass(descriptor, cl);
+ return class_linker->FindClass(descriptor.c_str(), cl);
} else if (*p == 'L') {
const char* start = p;
while (*p != ';') {
++p;
}
++p;
- StringPiece descriptor(start, (p - start));
- return class_linker->FindClass(descriptor.ToString(), cl);
+ std::string descriptor(start, (p - start));
+ return class_linker->FindClass(descriptor.c_str(), cl);
} else {
return class_linker->FindPrimitiveClass(*p++);
}