Revert^2 "ART: Fix some performance-X tidy"
This reverts commit 6856214f2c849600bcb94cc6e84975ba8cb69920.
Fix lifetime issue in imgdiag.
Test: mmma art
Test: m test-art-target-gtest-imgdiag_test
Change-Id: I919db6310c0713313340adfe66bcd75a1c5c236e
diff --git a/dex2oat/dex2oat_test.cc b/dex2oat/dex2oat_test.cc
index a060fd2..ad44624 100644
--- a/dex2oat/dex2oat_test.cc
+++ b/dex2oat/dex2oat_test.cc
@@ -1768,7 +1768,7 @@
writer.Finish();
ASSERT_EQ(apk_file.GetFile()->Flush(), 0);
}
- const std::string dex_location = apk_file.GetFilename();
+ const std::string& dex_location = apk_file.GetFilename();
const std::string odex_location = GetOdexDir() + "/output.odex";
GenerateOdexForTest(dex_location,
odex_location,
@@ -1974,7 +1974,7 @@
<< "Failed to find candidate code item with only one code unit in last instruction.";
});
- std::string dex_location = temp_dex.GetFilename();
+ const std::string& dex_location = temp_dex.GetFilename();
std::string odex_location = GetOdexDir() + "/quickened.odex";
std::string vdex_location = GetOdexDir() + "/quickened.vdex";
std::unique_ptr<File> vdex_output(OS::CreateEmptyFile(vdex_location.c_str()));
@@ -2049,7 +2049,7 @@
writer.Finish();
ASSERT_EQ(invalid_dex.GetFile()->Flush(), 0);
}
- const std::string dex_location = invalid_dex.GetFilename();
+ const std::string& dex_location = invalid_dex.GetFilename();
const std::string odex_location = GetOdexDir() + "/output.odex";
std::string error_msg;
int status = GenerateOdexForTestWithStatus(