From a566a3acc84386e4738711d27a250f63e59cbb6b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 18 Oct 2019 08:37:27 +0200 Subject: Optimize config::required() to move default value if possible --- libbuild2/config/utility.txx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libbuild2/config/utility.txx') diff --git a/libbuild2/config/utility.txx b/libbuild2/config/utility.txx index 9c1455f..4c4e305 100644 --- a/libbuild2/config/utility.txx +++ b/libbuild2/config/utility.txx @@ -13,7 +13,7 @@ namespace build2 pair required (scope& root, const variable& var, - const T& def_val, + T&& def_val, bool def_ovr, uint64_t save_flags) { @@ -35,7 +35,7 @@ namespace build2 // if (!l.defined () || (def_ovr && !l.belongs (root))) { - value& v (root.assign (var) = def_val); + value& v (root.assign (var) = std::forward (def_val)); // VC14 v.extra = true; // Default value flag. n = (save_flags & save_commented) == 0; // Absence means default. -- cgit v1.1