aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-03-31 07:41:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-03-31 07:41:45 +0200
commit9024e707e82f80230caa488a499ecaae563f585e (patch)
tree28d79892aabd9b41bf17203d0883fddc1b060262 /libbuild2
parentdfb51bc816cde2cb345f8a0300205e6ac95a2065 (diff)
Use find instead of insert for variable lookup in install_{path,mode}()
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/install/utility.hxx6
1 files changed, 4 insertions, 2 deletions
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<path> (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);