Don't default-construct std::strings and then assign them.
Change-Id: I8c994d1e6a8d2ebe52eaa4f0132e0deb2ecfa5f3
diff --git a/src/class_linker.cc b/src/class_linker.cc
index 88016f4..ab5f9d6 100644
--- a/src/class_linker.cc
+++ b/src/class_linker.cc
@@ -696,7 +696,7 @@
}
// not found in /foo/bar/baz.oat? try /data/art-cache/foo@bar@baz.oat
- std::string cache_location = GetArtCacheFilenameOrDie(oat_location);
+ std::string cache_location(GetArtCacheFilenameOrDie(oat_location));
oat_file = FindOpenedOatFileFromOatLocation(cache_location);
if (oat_file != NULL) {
return oat_file;
@@ -739,7 +739,7 @@
static_cast<uint32_t>(dex_caches->GetLength()));
for (int i = 0; i < dex_caches->GetLength(); i++) {
SirtRef<DexCache> dex_cache(dex_caches->Get(i));
- const std::string& dex_file_location = dex_cache->GetLocation()->ToModifiedUtf8();
+ const std::string& dex_file_location(dex_cache->GetLocation()->ToModifiedUtf8());
std::string dex_filename;
dex_filename += runtime->GetHostPrefix();
@@ -1018,7 +1018,7 @@
}
} else {
- std::string class_name_string = DescriptorToDot(descriptor);
+ std::string class_name_string(DescriptorToDot(descriptor));
ScopedThreadStateChange(self, Thread::kNative);
JNIEnv* env = self->GetJniEnv();
ScopedLocalRef<jclass> c(env, AddLocalReference<jclass>(env, GetClassRoot(kJavaLangClassLoader)));