Prevent unnecessary copies in ScopedValueCache

This commit is contained in:
Robbert van der Helm
2021-04-29 02:58:05 +02:00
parent ee24969539
commit 22f94dd22f
+1 -1
View File
@@ -177,7 +177,7 @@ class ScopedValueCache {
* @throw std::runtime_error When we are already caching a value. * @throw std::runtime_error When we are already caching a value.
*/ */
Guard set(T new_value) { Guard set(T new_value) {
value = new_value; value = std::move(new_value);
return Guard(value); return Guard(value);
} }