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/Interface.cpp b/Interface.cpp
index db5d682..208a83d 100644
--- a/Interface.cpp
+++ b/Interface.cpp
@@ -576,7 +576,7 @@
     return isIBase() ? std::vector<InterfaceAndMethod>() : superType()->allMethodsFromRoot();
 }
 
-Method *Interface::lookupMethod(std::string name) const {
+Method *Interface::lookupMethod(const std::string& name) const {
     for (const auto &tuple : allMethodsFromRoot()) {
         Method *method = tuple.method();
         if (method->name() == name) {
@@ -736,9 +736,7 @@
     return OK;
 }
 
-
-status_t Interface::emitTypeDefinitions(
-        Formatter &out, const std::string prefix) const {
+status_t Interface::emitTypeDefinitions(Formatter& out, const std::string& prefix) const {
     std::string space = prefix.empty() ? "" : (prefix + "::");
     status_t err = Scope::emitTypeDefinitions(out, space + localName());
     if (err != OK) {