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: Ie79dbe21899867bc62031f8618bb1322b8071525
Test: build with WITH_TIDY=1
diff --git a/init/util.cpp b/init/util.cpp
index 80b2325..c1750d2 100644
--- a/init/util.cpp
+++ b/init/util.cpp
@@ -317,7 +317,7 @@
}
void import_kernel_cmdline(bool in_qemu,
- std::function<void(const std::string&, const std::string&, bool)> fn) {
+ const std::function<void(const std::string&, const std::string&, bool)>& fn) {
std::string cmdline;
android::base::ReadFileToString("/proc/cmdline", &cmdline);