diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-03-31 10:59:45 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-03-31 10:59:45 +0200 |
commit | 7253ffee27f6cae34e63a72b2d3d10db10571ecc (patch) | |
tree | c86b321ad4d2bcb05eda451ad3cae5ac8429cabf /build2/file.cxx | |
parent | 6417a4e6af2b7732ec0da6af24f1a56f7cdada3f (diff) |
Clean up variable lookup interfaces
Diffstat (limited to 'build2/file.cxx')
-rw-r--r-- | build2/file.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/build2/file.cxx b/build2/file.cxx index 1f4e517..10461c4 100644 --- a/build2/file.cxx +++ b/build2/file.cxx @@ -263,9 +263,9 @@ namespace build2 source_once (bf, root, root); } - // Extract the specified variable value from a buildfile. It is - // expected to be the first non-comment line and not to rely on - // any variable expansion other than those from the global scope. + // Extract the specified variable value from a buildfile. It is expected to + // be the first non-comment line and not to rely on any variable expansion + // other than those from the global scope or any variable overrides. // static value extract_variable (const path& bf, const char* name) @@ -297,10 +297,9 @@ namespace build2 temp_scope tmp (*global_scope); p.parse_variable (lex, tmp, var, tt); - auto l (tmp.vars[var]); - assert (l.defined ()); - value& v (*l); - return move (v); // Steal the value, the scope is going away. + value* v (tmp.vars.find (var)); + assert (v != nullptr); + return move (*v); // Steal the value, the scope is going away. } catch (const ifstream::failure&) { |