Don't default-construct std::strings and then assign them.
Change-Id: I8c994d1e6a8d2ebe52eaa4f0132e0deb2ecfa5f3
diff --git a/src/object_utils.h b/src/object_utils.h
index f323190..c086fb8 100644
--- a/src/object_utils.h
+++ b/src/object_utils.h
@@ -52,7 +52,7 @@
std::string GetDescriptor() {
if (klass_->IsArrayClass()) {
- std::string result = "[";
+ std::string result("[");
const Class* saved_klass = klass_;
ChangeClass(klass_->GetComponentType());
result += GetDescriptor();
@@ -118,7 +118,7 @@
}
}
const char* GetSourceFile() {
- std::string descriptor = GetDescriptor();
+ std::string descriptor(GetDescriptor());
const DexFile& dex_file = GetDexFile();
const DexFile::ClassDef* dex_class_def = dex_file.FindClassDef(descriptor);
if (dex_class_def == NULL) {