From 962f83b1e551cc683f1052d32cb79b969e65af5f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 16 Mar 2020 08:57:29 +0200 Subject: Rename all find*(variable) to lookup*(variable) Now we consistently use term "lookup" for variable value lookup. At some point we should also rename type lookup to binding and get rid of all the lookup_type aliases. --- libbuild2/variable.hxx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'libbuild2/variable.hxx') diff --git a/libbuild2/variable.hxx b/libbuild2/variable.hxx index 02df60b..071cb5f 100644 --- a/libbuild2/variable.hxx +++ b/libbuild2/variable.hxx @@ -1362,44 +1362,46 @@ namespace build2 // Lookup. Note that variable overrides will not be applied, even if // set in this map. // - lookup + using lookup_type = build2::lookup; + + lookup_type operator[] (const variable& var) const { - auto p (find (var)); - return lookup (p.first, &p.second, this); + auto p (lookup (var)); + return lookup_type (p.first, &p.second, this); } - lookup + lookup_type operator[] (const variable* var) const // For cached variables. { assert (var != nullptr); return operator[] (*var); } - lookup + lookup_type operator[] (const string& name) const { const variable* var (ctx != nullptr ? ctx->var_pool.find (name) : nullptr); - return var != nullptr ? operator[] (*var) : lookup (); + return var != nullptr ? operator[] (*var) : lookup_type (); } // If typed is false, leave the value untyped even if the variable is. // The second half of the pair is the storage variable. // pair - find (const variable&, bool typed = true) const; + lookup (const variable&, bool typed = true) const; pair - find_to_modify (const variable&, bool typed = true); + lookup_to_modify (const variable&, bool typed = true); // Convert a lookup pointing to a value belonging to this variable map // to its non-const version. Note that this is only safe on the original // values (see find_original()). // value& - modify (const lookup& l) + modify (const lookup_type& l) { assert (l.vars == this); value& r (const_cast (*l.value)); @@ -1432,7 +1434,7 @@ namespace build2 insert (const variable&, bool typed = true); pair - find_namespace (const variable& ns) const + lookup_namespace (const variable& ns) const { auto r (m_.find_sub (ns)); return make_pair (const_iterator (r.first, *this), -- cgit v1.1