From a287592b9c1128727228391cb3615f72df4eb442 Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Tue, 3 Sep 2024 16:44:54 +0900 Subject: [PATCH] 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: I6d967966f75fb15e9b5c5e4661bd5ca3af37e8e0 --- fastboot/vendor_boot_img_utils_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastboot/vendor_boot_img_utils_test.cpp b/fastboot/vendor_boot_img_utils_test.cpp index 467c6e9d9..81072705d 100644 --- a/fastboot/vendor_boot_img_utils_test.cpp +++ b/fastboot/vendor_boot_img_utils_test.cpp @@ -163,7 +163,7 @@ struct TestFileHandle { protected: // |rel_path| is the relative path under test data directory. TestFileHandle(const std::filesystem::path& rel_path) - : abs_path_(std::move(std::filesystem::path(GetExecutableDirectory()) / rel_path)) {} + : abs_path_(std::filesystem::path(GetExecutableDirectory()) / rel_path) {} // Given |read_fd|, the readonly fd on the test file, return an fd that's suitable for client // to use. Implementation is responsible for managing the lifetime of the returned fd. virtual android::base::Result Transform(const std::filesystem::path& abs_path,