aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-08-05 18:18:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-08-05 18:18:26 +0200
commitc291ac321aa9863c515f84ba0b8b1599c5da2c9a (patch)
tree54ba44a3262f7c93cceaee80851c6095ed1b50bf
parentd9f0bc64898a207e5b15da443a92cc6c51ded419 (diff)
Rename path_map::find_sub() to find_sup()
-rw-r--r--libbutl/path-map.hxx27
1 files changed, 13 insertions, 14 deletions
diff --git a/libbutl/path-map.hxx b/libbutl/path-map.hxx
index 5f282fb..fa06bd5 100644
--- a/libbutl/path-map.hxx
+++ b/libbutl/path-map.hxx
@@ -14,18 +14,17 @@ namespace butl
{
// prefix_map for filesystem paths
//
- // Important: the paths should be normalized but can use different case
- // on case-insensitive platforms.
+ // Important: the paths should be normalized but can use different directory
+ // separators and different case on case-insensitive platforms.
//
- // Note that the path's representation of POSIX root ('/') is
- // inconsistent in that we have a trailing delimiter at the end of
- // the path (its "proper" representation would have been an empty
- // string but that would have clashed with empty paths). To work
- // around this snag, this implementation, during key comparison,
- // detects '/' and treats it as empty. Note that the map will
- // still store the key as you have first inserted it. So if you
- // want a particular representation (i.e., empty or '/'), pre-
- // populate the map with it.
+ // Note that the path's representation of POSIX root ('/') is inconsistent
+ // in that we have a trailing delimiter at the end of the path (its "proper"
+ // representation would have been an empty string but that would have
+ // clashed with empty paths). To work around this snag, this implementation,
+ // during key comparison, detects '/' and treats it as empty. Note that the
+ // map will still store the key as you have first inserted it. So if you
+ // want a particular representation (i.e., empty or '/'), pre- populate the
+ // map with it.
//
template <typename C, typename K>
struct compare_prefix<basic_path<C, K>>
@@ -118,10 +117,10 @@ namespace butl
using iterator = typename base::iterator;
using const_iterator = typename base::const_iterator;
- // Find the most qualified entry of which this path is a sub-path.
+ // Find the most qualified entry that is a superpath of this path.
//
iterator
- find_sub (const P& p)
+ find_sup (const P& p)
{
// Get the greatest less than, if any. We might still not be a sub. Note
// also that we still have to check the last element if upper_bound()
@@ -132,7 +131,7 @@ namespace butl
}
const_iterator
- find_sub (const P& p) const
+ find_sup (const P& p) const
{
auto i (this->upper_bound (p));
return i == this->begin () || !p.sub ((--i)->first) ? this->end () : i;