aboutsummaryrefslogtreecommitdiff
path: root/build2/config
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-01-18 11:41:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-01-18 11:41:23 +0200
commitd0954351f53c0de0d2b0a0e0f422a40f82142d5c (patch)
tree50b201da74cb3b56da8b7d53c970c4bdfcd827af /build2/config
parent14b295bdb00305370ec0aaad7f4319bad55ad6e9 (diff)
Use prefix_map::find_sup/sub()
Diffstat (limited to 'build2/config')
-rw-r--r--build2/config/module.cxx14
1 files changed, 1 insertions, 13 deletions
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.
//