aboutsummaryrefslogtreecommitdiff
path: root/build/scope.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-08-17 11:18:10 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-08-17 11:18:10 +0200
commit0d5234f4aefd3cc5b5948cc1b9dd009e50046f5e (patch)
treeb8b3bdfe8e3a6f688434bcb3d9b37e110f47dda3 /build/scope.cxx
parent040ebadfa9e606b56005b80571e7fc714a3f1f2c (diff)
Tighten variable_map interface
Diffstat (limited to 'build/scope.cxx')
-rw-r--r--build/scope.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/build/scope.cxx b/build/scope.cxx
index 600c46e..d878726 100644
--- a/build/scope.cxx
+++ b/build/scope.cxx
@@ -17,13 +17,11 @@ namespace build
{
for (const scope* s (this); s != nullptr; s = s->parent_scope ())
{
- auto i (s->vars.find (var));
- if (i != s->vars.end ())
- // @@ Same issue as in variable_map: need ro_value_proxy.
- return value_proxy (&const_cast<value_ptr&> (i->second), &s->vars);
+ if (const value_ptr* v = s->vars.find (var))
+ return value_proxy (v, &s->vars);
}
- return value_proxy (nullptr, nullptr);
+ return value_proxy ();
}
value_proxy scope::