commit | 3ac211f58d4acb1c9865cbcf95677945a7b673d4 | [log] [tgz] |
---|---|---|
author | Yi Kong <yikong@google.com> | Mon Aug 12 07:31:44 2024 +0800 |
committer | Yi Kong <yikong@google.com> | Mon Aug 12 07:31:59 2024 +0800 |
tree | 09179362f33d275c0db06b27b3c07c1f5516851b | |
parent | 6fe6b4380a07766813edc4863721f3af8d5218b4 [diff] [blame] |
Remove unnecessary std::move Moving a temporary object prevents copy elision, and could reduce performance. This fixes -Wpessimizing-move compiler warning. Test: presubmit Bug: 154270751 Change-Id: Ia0b02d90c239572c953007272f75900ee77c6305
diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp index caa6424..6347863 100644 --- a/services/camera/libcameraservice/api1/Camera2Client.cpp +++ b/services/camera/libcameraservice/api1/Camera2Client.cpp
@@ -419,7 +419,7 @@ result << " none\n"; } - std::string resultStr = std::move(result.str()); + std::string resultStr = result.str(); write(fd, resultStr.c_str(), resultStr.size());