From 45c9008b9679aeed32487f065e3e594f320c8b9f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 2 Jul 2020 08:41:02 +0200 Subject: Optimize variable extraction in bootstrap_src() --- libbuild2/config/init.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libbuild2/config/init.cxx') 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 (p.first) : 0); + optional ov (extract_variable (rs.ctx, lex, c_v)); + uint64_t v (ov ? cast (*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 (); -- cgit v1.1