diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-10-13 09:00:11 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-10-13 09:00:11 +0200 |
commit | 219e00f3b8caec38a9c8fbb4d70e33455aba5a92 (patch) | |
tree | af77a460d37589b6ca535cdd8d0100440d9f45a1 /libbuild2/config | |
parent | 7935281661a3fd50454432fae1bbf4152758137a (diff) |
Optimize by going straight to public variable pool where applicable
Diffstat (limited to 'libbuild2/config')
-rw-r--r-- | libbuild2/config/init.cxx | 7 | ||||
-rw-r--r-- | libbuild2/config/utility.cxx | 4 | ||||
-rw-r--r-- | libbuild2/config/utility.hxx | 4 |
3 files changed, 9 insertions, 6 deletions
diff --git a/libbuild2/config/init.cxx b/libbuild2/config/init.cxx index 72ded05..7035ce5 100644 --- a/libbuild2/config/init.cxx +++ b/libbuild2/config/init.cxx @@ -100,7 +100,10 @@ namespace build2 // reserved to not be valid module names (`build`). We also currently // treat `import` as special. // - 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 */)); // NOTE: all config.** variables are by default made (via a pattern) to // be overridable with global visibility. So we must override this if a @@ -234,7 +237,7 @@ namespace build2 ? &extra.module_as<module> () : nullptr); - auto& vp (rs.var_pool ()); + auto& vp (rs.var_pool (true /* public */)); // Note: config.* is pattern-typed to global visibility. // diff --git a/libbuild2/config/utility.cxx b/libbuild2/config/utility.cxx index 314de84..6574367 100644 --- a/libbuild2/config/utility.cxx +++ b/libbuild2/config/utility.cxx @@ -130,7 +130,7 @@ namespace build2 // Pattern-typed as bool. // const variable& var ( - rs.var_pool ().insert ("config." + n + ".configured")); + rs.var_pool (true).insert ("config." + n + ".configured")); save_variable (rs, var); @@ -144,7 +144,7 @@ namespace build2 // Pattern-typed as bool. // const variable& var ( - rs.var_pool ().insert ("config." + n + ".configured")); + rs.var_pool (true).insert ("config." + n + ".configured")); save_variable (rs, var); diff --git a/libbuild2/config/utility.hxx b/libbuild2/config/utility.hxx index 98d7ec0..1e2ff53 100644 --- a/libbuild2/config/utility.hxx +++ b/libbuild2/config/utility.hxx @@ -435,7 +435,7 @@ namespace build2 const V* cv ( cast_null<V> ( lookup_config (rs, - rs.var_pool ().insert<V> ("config." + var), + rs.var_pool (true).insert<V> ("config." + var), std::forward<T> (default_value)))); // VC14 value& v (bs.assign<V> (move (var))); @@ -453,7 +453,7 @@ namespace build2 const V* cv ( cast_null<V> ( lookup_config (rs, - rs.var_pool ().insert<V> ("config." + var), + rs.var_pool (true).insert<V> ("config." + var), std::forward<T> (default_value)))); // VC14 value& v (bs.append<V> (move (var))); |