Fix clang-tidy performance warnings in frameworks/native.
* Use const reference parameter type to avoid unnecessary copy.
* Use more efficient overloaded string methods.
* Use const reference type for loop index variables to avoid unnecessary copy.
(cherry picked from commit cb057c2e6bf23b43df49282c0db26b663e4535f7)
Bug: 30407689
Bug: 30411878
Bug: 30413223
Test: build with WITH_TIDY=1
Merged-In: I75ed62e2cb9939878b8932ed512ceb7e241edd6f
Change-Id: I75ed62e2cb9939878b8932ed512ceb7e241edd6f
diff --git a/opengl/tests/hwc/hwcRects.cpp b/opengl/tests/hwc/hwcRects.cpp
index 69e56ff..5956366 100644
--- a/opengl/tests/hwc/hwcRects.cpp
+++ b/opengl/tests/hwc/hwcRects.cpp
@@ -170,7 +170,7 @@
static EGLint width, height;
// Function prototypes
-static Rectangle parseRect(string rectStr);
+static Rectangle parseRect(const string& rectStr);
void init(void);
void printSyntax(const char *cmd);
@@ -358,7 +358,7 @@
// Parse string description of rectangle and add it to list of rectangles
// to be rendered.
-static Rectangle parseRect(string rectStr)
+static Rectangle parseRect(const string& rectStr)
{
int rv;
string str;