Pass some arguments by const reference.
Test: Rely on TreeHugger.
Bug: 32619234
Change-Id: Ia26277893641dcb3562eaeacaec4e089a978d56a
diff --git a/runtime/jdwp/jdwp_event.cc b/runtime/jdwp/jdwp_event.cc
index 85bfd17..fad7d90 100644
--- a/runtime/jdwp/jdwp_event.cc
+++ b/runtime/jdwp/jdwp_event.cc
@@ -781,7 +781,7 @@
SendRequestAndPossiblySuspend(pReq, suspend_policy, threadId);
}
-static void LogMatchingEventsAndThread(const std::vector<JdwpEvent*> match_list,
+static void LogMatchingEventsAndThread(const std::vector<JdwpEvent*>& match_list,
ObjectId thread_id)
REQUIRES_SHARED(Locks::mutator_lock_) {
for (size_t i = 0, e = match_list.size(); i < e; ++i) {
diff --git a/runtime/oat_file_manager.cc b/runtime/oat_file_manager.cc
index fde0a2c..8efb465 100644
--- a/runtime/oat_file_manager.cc
+++ b/runtime/oat_file_manager.cc
@@ -377,7 +377,7 @@
}
}
-static bool AreSharedLibrariesOk(const std::string shared_libraries,
+static bool AreSharedLibrariesOk(const std::string& shared_libraries,
std::priority_queue<DexFileAndClassPair>& queue) {
if (shared_libraries.empty()) {
if (queue.empty()) {
diff --git a/runtime/runtime.h b/runtime/runtime.h
index 77ec238..6f68960 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -182,7 +182,7 @@
return compiler_options_;
}
- void AddCompilerOption(std::string option) {
+ void AddCompilerOption(const std::string& option) {
compiler_options_.push_back(option);
}
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index 97bc79c..d9e3ea7 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -956,7 +956,7 @@
delete last_fail_message;
}
-void MethodVerifier::AppendToLastFailMessage(std::string append) {
+void MethodVerifier::AppendToLastFailMessage(const std::string& append) {
size_t failure_num = failure_messages_.size();
DCHECK_NE(failure_num, 0U);
std::ostringstream* last_fail_message = failure_messages_[failure_num - 1];
diff --git a/runtime/verifier/method_verifier.h b/runtime/verifier/method_verifier.h
index eb8b7a6..c6ce583 100644
--- a/runtime/verifier/method_verifier.h
+++ b/runtime/verifier/method_verifier.h
@@ -318,7 +318,7 @@
void PrependToLastFailMessage(std::string);
// Adds the given string to the end of the last failure message.
- void AppendToLastFailMessage(std::string);
+ void AppendToLastFailMessage(const std::string& append);
// Verification result for method(s). Includes a (maximum) failure kind, and (the union of)
// all failure types.