mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Prevent unnecessary copies in ScopedValueCache
This commit is contained in:
+1
-1
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user