Fix clang-tidy performance warnings.
* Use const reference type for read-only parameters.
Bug: 30407689
Test: build with WITH_TIDY=1
Change-Id: I7c19a10f0ae0b4784851bedbcaf1c4565c6616d1
diff --git a/cpp/BaseObj.cpp b/cpp/BaseObj.cpp
index c1a3e55..59eaa9a 100644
--- a/cpp/BaseObj.cpp
+++ b/cpp/BaseObj.cpp
@@ -27,7 +27,7 @@
return mID;
}
-void * BaseObj::getObjID(sp<const BaseObj> o) {
+void * BaseObj::getObjID(const sp<const BaseObj>& o) {
return o == nullptr ? nullptr : o->getID();
}
@@ -57,7 +57,7 @@
mName = name;
}
-bool BaseObj::equals(sp<const BaseObj> obj) {
+bool BaseObj::equals(const sp<const BaseObj>& obj) {
// Early-out check to see if both BaseObjs are actually the same.
if (this == obj.get())
return true;