From 8d2e541ab1aa24140eb680fb046e49a4a3f0bbd2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 12 Oct 2016 14:51:27 +0200 Subject: Various design/implementation cleanups --- build2/target | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'build2/target') diff --git a/build2/target b/build2/target index 681fcee..8fc0e8c 100644 --- a/build2/target +++ b/build2/target @@ -359,7 +359,7 @@ namespace build2 lookup operator[] (const string& name) const { - return operator[] (var_pool.find (name)); + return operator[] (var_pool[name]); } // As above but also return the depth at which the value is found. The @@ -370,6 +370,7 @@ namespace build2 // that given two lookups from the same target, we can say which one came // earlier. If no value is found, then the depth is set to ~0. // + // pair find (const variable& var) const { @@ -380,10 +381,13 @@ namespace build2 } pair - find (const string& name) const {return find (var_pool.find (name));} + find (const string& name) const {return find (var_pool[name]);} + // If target_only is true, then only look in target and its target group + // without continuing in scopes. + // pair - find_original (const variable&) const; + find_original (const variable&, bool target_only = false) const; // Return a value suitable for assignment. See scope for details. // @@ -409,7 +413,7 @@ namespace build2 value& append (const string& name) { - return append (var_pool.find (name)); + return append (var_pool[name]); } public: -- cgit v1.1