From 9f71deeeb0f8e6fe2c29f209fc96f466fc2831b6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 16 Mar 2020 08:06:15 +0200 Subject: Rework config::{omitted,required,optional}() into unified config_lookup() --- libbuild2/config/utility.cxx | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'libbuild2/config/utility.cxx') diff --git a/libbuild2/config/utility.cxx b/libbuild2/config/utility.cxx index b9fc513..8ad150e 100644 --- a/libbuild2/config/utility.cxx +++ b/libbuild2/config/utility.cxx @@ -17,9 +17,9 @@ namespace build2 namespace config { pair - omitted (scope& rs, const variable& var) + lookup_config_impl (scope& rs, const variable& var) { - // This is a stripped-down version of the required()'s twisted logic. + // This is a stripped-down version of the default value case. pair org (rs.find_original (var)); @@ -50,19 +50,8 @@ namespace build2 return pair (l, n); } - lookup - optional (scope& rs, const variable& var) - { - save_variable (rs, var); - - auto l (rs[var]); - return l.defined () - ? l - : lookup (rs.assign (var), var, rs); // NULL. - } - bool - specified (scope& rs, const string& n) + specified_config (scope& rs, const string& n) { // Search all outer scopes for any value in this namespace. // -- cgit v1.1