From 22f94dd22f17f12eee839c6237a632e902fd3bf8 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Thu, 29 Apr 2021 02:58:05 +0200 Subject: [PATCH] Prevent unnecessary copies in ScopedValueCache --- src/common/utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/utils.h b/src/common/utils.h index e64ce844..4f14e4fd 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -177,7 +177,7 @@ class ScopedValueCache { * @throw std::runtime_error When we are already caching a value. */ Guard set(T new_value) { - value = new_value; + value = std::move(new_value); return Guard(value); }