summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jiakai Zhang <jiakaiz@google.com> 2025-03-21 06:31:58 -0700
committer Jiakai Zhang <jiakaiz@google.com> 2025-03-21 06:31:58 -0700
commit4f163f8c78d545603474d032cd2b587dec289f04 (patch)
tree4760b780321eba624a77a2109a53a19d0d37c61a
parentdcc57092954854e5abb6a9fa21e6f13359673ee4 (diff)
Pass filename by reference.
Bug: 377474232 Test: Presubmit Change-Id: Ib02f2f987c876c931ecc9ef42969eea0bbad9f77
-rw-r--r--runtime/oat/sdc_file.cc2
-rw-r--r--runtime/oat/sdc_file.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/runtime/oat/sdc_file.cc b/runtime/oat/sdc_file.cc
index 59b9655ac2..e141aea85e 100644
--- a/runtime/oat/sdc_file.cc
+++ b/runtime/oat/sdc_file.cc
@@ -36,7 +36,7 @@ using ::android::base::ParseInt;
using ::android::base::ReadFileToString;
using ::android::base::WriteStringToFd;
-std::unique_ptr<SdcReader> SdcReader::Load(const std::string filename, std::string* error_msg) {
+std::unique_ptr<SdcReader> SdcReader::Load(const std::string& filename, std::string* error_msg) {
std::unique_ptr<SdcReader> reader(new SdcReader());
// The sdc file is supposed to be small, so read fully into memory for simplicity.
diff --git a/runtime/oat/sdc_file.h b/runtime/oat/sdc_file.h
index 73917f5316..e2c9b43ba7 100644
--- a/runtime/oat/sdc_file.h
+++ b/runtime/oat/sdc_file.h
@@ -45,7 +45,7 @@ namespace art HIDDEN {
// Repeated keys are not allowed. This is an extensible format, so versioning is not needed.
class EXPORT SdcReader {
public:
- static std::unique_ptr<SdcReader> Load(const std::string filename, std::string* error_msg);
+ static std::unique_ptr<SdcReader> Load(const std::string& filename, std::string* error_msg);
// The mtime of the SDM file on device, in nanoseconds.
// This is for detecting obsolete SDC files.