From 219e00f3b8caec38a9c8fbb4d70e33455aba5a92 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 Oct 2022 09:00:11 +0200 Subject: Optimize by going straight to public variable pool where applicable --- libbuild2/bin/init.cxx | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'libbuild2/bin/init.cxx') diff --git a/libbuild2/bin/init.cxx b/libbuild2/bin/init.cxx index 265521e..4b6090a 100644 --- a/libbuild2/bin/init.cxx +++ b/libbuild2/bin/init.cxx @@ -54,11 +54,14 @@ namespace build2 // Enter variables. // + // All the variables we enter are qualified so go straight for the + // public variable pool. + // + auto& vp (rs.var_pool (true /* public */)); + // Target is a string and not target_triplet because it can be // specified by the user. // - auto& vp (rs.var_pool ()); - vp.insert ("config.bin.target"); vp.insert ("config.bin.pattern"); @@ -628,7 +631,10 @@ namespace build2 // if (first) { - auto& vp (rs.var_pool ()); + // All the variables we enter are qualified so go straight for the + // public variable pool. + // + auto& vp (rs.var_pool (true /* public */)); vp.insert ("config.bin.ar"); vp.insert ("config.bin.ranlib"); @@ -802,7 +808,10 @@ namespace build2 // if (first) { - auto& vp (rs.var_pool ()); + // All the variables we enter are qualified so go straight for the + // public variable pool. + // + auto& vp (rs.var_pool (true /* public */)); vp.insert ("config.bin.ld"); } @@ -960,7 +969,10 @@ namespace build2 // if (first) { - auto& vp (rs.var_pool ()); + // All the variables we enter are qualified so go straight for the + // public variable pool. + // + auto& vp (rs.var_pool (true /* public */)); vp.insert ("config.bin.rc"); } @@ -1059,7 +1071,10 @@ namespace build2 // if (first) { - auto& vp (rs.var_pool ()); + // All the variables we enter are qualified so go straight for the + // public variable pool. + // + auto& vp (rs.var_pool (true /* public */)); vp.insert ("config.bin.nm"); } -- cgit v1.1