From 9024e707e82f80230caa488a499ecaae563f585e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 31 Mar 2020 07:41:45 +0200 Subject: Use find instead of insert for variable lookup in install_{path,mode}() --- libbuild2/install/utility.hxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libbuild2/install/utility.hxx') diff --git a/libbuild2/install/utility.hxx b/libbuild2/install/utility.hxx index cb9203c..ee78e17 100644 --- a/libbuild2/install/utility.hxx +++ b/libbuild2/install/utility.hxx @@ -18,12 +18,14 @@ namespace build2 { // Set install path, mode for a target type. // + // Note: should only be called if the install module is loaded. + // inline void install_path (scope& s, const target_type& tt, dir_path d) { auto r ( s.target_vars[tt]["*"].insert ( - s.var_pool ().insert ("install"))); + *s.var_pool ().find ("install"))); if (r.second) // Already set by the user? r.first.get () = path_cast (move (d)); @@ -41,7 +43,7 @@ namespace build2 { auto r ( s.target_vars[tt]["*"].insert ( - s.var_pool ().insert ("install.mode"))); + *s.var_pool ().find ("install.mode"))); if (r.second) // Already set by the user? r.first.get () = move (m); -- cgit v1.1