Fix clang-tidy performance warnings in system/tools/hidl.

* Use const reference parameter type to avoid unnecessary copy.
* Use more efficient overloaded string methods.

Bug: 30407689
Bug: 30411878
Test: build with WITH_TIDY=1
Change-Id: Ib90a35106eb59d05878b75504b87ef324211cc6b
diff --git a/c2hal/AST.cpp b/c2hal/AST.cpp
index e2ae13c..e2eae91 100644
--- a/c2hal/AST.cpp
+++ b/c2hal/AST.cpp
@@ -317,7 +317,7 @@
 
     size_t start = 1;  // Ignore leading '/'
     size_t slashPos;
-    while ((slashPos = path.find("/", start)) != std::string::npos) {
+    while ((slashPos = path.find('/', start)) != std::string::npos) {
         std::string partial = path.substr(0, slashPos);
 
         struct stat st;