Don't default-construct std::strings and then assign them.
Change-Id: I8c994d1e6a8d2ebe52eaa4f0132e0deb2ecfa5f3
diff --git a/src/compiler/codegen/arm/ArchUtility.cc b/src/compiler/codegen/arm/ArchUtility.cc
index b702682..52fb018 100644
--- a/src/compiler/codegen/arm/ArchUtility.cc
+++ b/src/compiler/codegen/arm/ArchUtility.cc
@@ -449,10 +449,9 @@
const art::DexFile::MethodId& method_id =
cUnit->dex_file->GetMethodId(cUnit->method_idx);
- std::string signature = cUnit->dex_file->GetMethodSignature(method_id);
- std::string name = cUnit->dex_file->GetMethodName(method_id);
- std::string descriptor =
- cUnit->dex_file->GetMethodDeclaringClassDescriptor(method_id);
+ std::string signature(cUnit->dex_file->GetMethodSignature(method_id));
+ std::string name(cUnit->dex_file->GetMethodName(method_id));
+ std::string descriptor(cUnit->dex_file->GetMethodDeclaringClassDescriptor(method_id));
// Dump mapping table
if (cUnit->mappingTable.size() > 0) {
diff --git a/src/compiler/codegen/arm/Thumb2/Gen.cc b/src/compiler/codegen/arm/Thumb2/Gen.cc
index b02cde5..6796f6c 100644
--- a/src/compiler/codegen/arm/Thumb2/Gen.cc
+++ b/src/compiler/codegen/arm/Thumb2/Gen.cc
@@ -36,10 +36,10 @@
void warnIfUnresolved(CompilationUnit* cUnit, int fieldIdx, Field* field) {
if (field == NULL) {
const art::DexFile::FieldId& field_id = cUnit->dex_file->GetFieldId(fieldIdx);
- std::string class_name = cUnit->dex_file->GetFieldDeclaringClassDescriptor(field_id);
- std::string field_name = cUnit->dex_file->GetFieldName(field_id);
- LOG(INFO) << "Field " << art::PrettyDescriptor(class_name) << "."
- << field_name << " unresolved at compile time";
+ std::string class_name(cUnit->dex_file->GetFieldDeclaringClassDescriptor(field_id));
+ std::string field_name(cUnit->dex_file->GetFieldName(field_id));
+ LOG(INFO) << "Field " << art::PrettyDescriptor(class_name) << "." << field_name
+ << " unresolved at compile time";
} else {
// We also use the slow path for wide volatile fields.
}