Fix clang-tidy performance warnings in syste/core.

* Use const reference type for parameters to avoid unnecessary copy.
* Suppress warning of not using faster overloaded string find function.

Bug: 30407689
Bug: 30411878
Change-Id: I6cfdbbd50cf5e8f3db6e5263076d3a17a9a791ee
Test: build with WITH_TIDY=1
Merged-In: Ie79dbe21899867bc62031f8618bb1322b8071525
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index 665b9d0..dde21d5 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -835,7 +835,7 @@
 }
 
 static void do_for_partition(Transport* transport, const char *part, const char *slot,
-                             std::function<void(const std::string&)> func, bool force_slot) {
+                             const std::function<void(const std::string&)>& func, bool force_slot) {
     std::string has_slot;
     std::string current_slot;
 
@@ -867,7 +867,7 @@
  * partition does not support slots.
  */
 static void do_for_partitions(Transport* transport, const char *part, const char *slot,
-                              std::function<void(const std::string&)> func, bool force_slot) {
+                              const std::function<void(const std::string&)>& func, bool force_slot) {
     std::string has_slot;
 
     if (slot && strcmp(slot, "all") == 0) {