Commit fe822457 by Maksim Ivanov Committed by Commit Bot

Fix useless move() in SizedMRUCache_unittest.cpp

Drop std::move() calls in places where there's no actual moving happing, and only the "bugprone-use-after-move" clang-tidy warning is triggered. Bug: chromium:1122844 Change-Id: I692da5af4f96305f09008d1c7fd18f9be7f6273f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2401241 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent d29d4c6b
...@@ -53,7 +53,8 @@ TEST(SizedMRUCacheTest, ManySmallValues) ...@@ -53,7 +53,8 @@ TEST(SizedMRUCacheTest, ManySmallValues)
for (size_t value = 0; value < kSize; ++value) for (size_t value = 0; value < kSize; ++value)
{ {
EXPECT_TRUE(sizedCache.put(value, std::move(value), 1)); size_t valueCopy = value;
EXPECT_TRUE(sizedCache.put(value, std::move(valueCopy), 1));
const size_t *qvalue = nullptr; const size_t *qvalue = nullptr;
EXPECT_TRUE(sizedCache.get(value, &qvalue)); EXPECT_TRUE(sizedCache.get(value, &qvalue));
...@@ -90,7 +91,8 @@ TEST(SizedMRUCacheTest, ManySmallValues) ...@@ -90,7 +91,8 @@ TEST(SizedMRUCacheTest, ManySmallValues)
// Put a bunch of items in the cache sequentially. // Put a bunch of items in the cache sequentially.
for (size_t value = 0; value < kSize * 10; ++value) for (size_t value = 0; value < kSize * 10; ++value)
{ {
EXPECT_TRUE(sizedCache.put(value, std::move(value), 1)); size_t valueCopy = value;
EXPECT_TRUE(sizedCache.put(value, std::move(valueCopy), 1));
} }
EXPECT_EQ(32u, sizedCache.size()); EXPECT_EQ(32u, sizedCache.size());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment