summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Stefano Cianciulli <scianciulli@google.com> 2024-05-08 15:28:37 +0000
committer Stefano Cianciulli <scianciulli@google.com> 2024-05-15 10:18:49 +0000
commit080f7b456e6bb62fbe2db6a4d871a31144f488f5 (patch)
tree53c3d0e620514728c14d8bfc4e868766ddda3cf6
parentcd39615402f99f5c7f6e5c3f436bc2e73bb14ccc (diff)
Fix performance-unnecessary-value-param clang-tidy issues
Bug: 264654008 Test: m tidy-art Change-Id: Ie4b543acd5cb636db30e18e501deb046ed194e1a
-rw-r--r--dex2oat/linker/oat_writer.cc2
-rw-r--r--dex2oat/linker/oat_writer.h9
-rw-r--r--dexopt_chroot_setup/dexopt_chroot_setup.cc2
-rw-r--r--runtime/thread.cc2
-rw-r--r--runtime/thread.h2
5 files changed, 8 insertions, 9 deletions
diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc
index 68e0690766..1419338066 100644
--- a/dex2oat/linker/oat_writer.cc
+++ b/dex2oat/linker/oat_writer.cc
@@ -488,7 +488,7 @@ bool OatWriter::AddVdexDexFilesSource(const VdexFile& vdex_file, const char* loc
}
// Add dex file source from raw memory.
-bool OatWriter::AddRawDexFileSource(std::shared_ptr<DexFileContainer> container,
+bool OatWriter::AddRawDexFileSource(const std::shared_ptr<DexFileContainer>& container,
const uint8_t* dex_file_begin,
const char* location,
uint32_t location_checksum) {
diff --git a/dex2oat/linker/oat_writer.h b/dex2oat/linker/oat_writer.h
index 43c9bc77ff..dc441a11d8 100644
--- a/dex2oat/linker/oat_writer.h
+++ b/dex2oat/linker/oat_writer.h
@@ -147,11 +147,10 @@ class OatWriter {
File&& dex_file_fd,
const char* location);
// Add dex file source from raw memory.
- bool AddRawDexFileSource(
- std::shared_ptr<DexFileContainer> container,
- const uint8_t* dex_file_begin,
- const char* location,
- uint32_t location_checksum);
+ bool AddRawDexFileSource(const std::shared_ptr<DexFileContainer>& container,
+ const uint8_t* dex_file_begin,
+ const char* location,
+ uint32_t location_checksum);
// Add dex file source(s) from a vdex file.
bool AddVdexDexFilesSource(
const VdexFile& vdex_file,
diff --git a/dexopt_chroot_setup/dexopt_chroot_setup.cc b/dexopt_chroot_setup/dexopt_chroot_setup.cc
index b83088ea76..35343c5b3c 100644
--- a/dexopt_chroot_setup/dexopt_chroot_setup.cc
+++ b/dexopt_chroot_setup/dexopt_chroot_setup.cc
@@ -82,7 +82,7 @@ const NoDestructor<std::string> kBindMountTmpDir(
constexpr mode_t kChrootDefaultMode = 0755;
constexpr std::chrono::milliseconds kSnapshotCtlTimeout = std::chrono::seconds(60);
-bool IsOtaUpdate(const std::optional<std::string> ota_slot) { return ota_slot.has_value(); }
+bool IsOtaUpdate(const std::optional<std::string>& ota_slot) { return ota_slot.has_value(); }
Result<void> Run(std::string_view log_name, const std::vector<std::string>& args) {
LOG(INFO) << "Running " << log_name << ": " << Join(args, /*separator=*/" ");
diff --git a/runtime/thread.cc b/runtime/thread.cc
index 2ebbe1327d..c648f0f55c 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -4846,7 +4846,7 @@ int Thread::GetNativePriority() const {
return priority;
}
-void Thread::AbortInThis(std::string message) {
+void Thread::AbortInThis(const std::string& message) {
std::string thread_name;
Thread::Current()->GetThreadName(thread_name);
LOG(ERROR) << message;
diff --git a/runtime/thread.h b/runtime/thread.h
index 943a7edff3..35e8fe8716 100644
--- a/runtime/thread.h
+++ b/runtime/thread.h
@@ -1550,7 +1550,7 @@ class EXPORT Thread {
// checkpoint. Useful mostly to discover why a thread isn't responding to a suspend request or
// checkpoint. The caller should "suspend" (in the Java sense) 'thread' before invoking this, so
// 'thread' can't get deallocated before we access it.
- NO_RETURN void AbortInThis(std::string message);
+ NO_RETURN void AbortInThis(const std::string& message);
// Returns true if StrictMode events are traced for the current thread.
static bool IsSensitiveThread() {