aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/config/init.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-07-02 08:41:02 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-07-02 08:41:02 +0200
commit45c9008b9679aeed32487f065e3e594f320c8b9f (patch)
tree8c1451e03fd20ce3938f3fd57b3aea1b1d05c888 /libbuild2/config/init.cxx
parent4bab5c56cd1c91a928af73e0d428d8cc361600f4 (diff)
Optimize variable extraction in bootstrap_src()
Diffstat (limited to 'libbuild2/config/init.cxx')
-rw-r--r--libbuild2/config/init.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/libbuild2/config/init.cxx b/libbuild2/config/init.cxx
index aa2c763..69da09c 100644
--- a/libbuild2/config/init.cxx
+++ b/libbuild2/config/init.cxx
@@ -204,13 +204,12 @@ namespace build2
// Assume missing version is 0.
//
- auto p (extract_variable (rs.ctx, lex, c_v));
- uint64_t v (p.second ? cast<uint64_t> (p.first) : 0);
+ optional<value> ov (extract_variable (rs.ctx, lex, c_v));
+ uint64_t v (ov ? cast<uint64_t> (*ov) : 0);
if (v != module::version)
fail (l) << "incompatible config file " << in <<
- info << "config file version " << v
- << (p.second ? "" : " (missing)") <<
+ info << "config file version " << v << (ov ? "" : " (missing)") <<
info << "config module version " << module::version <<
info << "consider reconfiguring " << project (rs) << '@'
<< rs.out_path ();