From d0954351f53c0de0d2b0a0e0f422a40f82142d5c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 18 Jan 2018 11:41:23 +0200 Subject: Use prefix_map::find_sup/sub() --- build2/config/module.cxx | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'build2/config') diff --git a/build2/config/module.cxx b/build2/config/module.cxx index 19b5125..4639d98 100644 --- a/build2/config/module.cxx +++ b/build2/config/module.cxx @@ -19,19 +19,7 @@ namespace build2 // prefix of this variable name. // auto& sm (saved_modules); - auto i (sm.end ()); - - if (!sm.empty ()) - { - i = sm.upper_bound (n); - - // Get the greatest less than, if any. We might still not be a - // suffix. And we still have to check the last element if - // upper_bound() returned end(). - // - if (i == sm.begin () || !sm.key_comp ().prefix ((--i)->first, n)) - i = sm.end (); - } + auto i (sm.find_sup (n)); // If no module matched, then create one based on the variable name. // -- cgit v1.1