aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-20 19:03:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-20 19:03:09 +0200
commit9565dd32bbd68d2fada2fbe2ece4b778b43e6bb0 (patch)
tree7c3ed171875d8e5e06e4ca5018c6cba389393d48
parentf9b7927440b89768613b7247e008efa574a6b38b (diff)
Minor/cosmetic changes to path::operator--()
-rw-r--r--butl/path18
1 files changed, 9 insertions, 9 deletions
diff --git a/butl/path b/butl/path
index 1b4e006..865da4e 100644
--- a/butl/path
+++ b/butl/path
@@ -414,15 +414,15 @@ namespace butl
{
e_ = b_;
- if (e_ != 0)
- {
- b_ = e_ == string_type::npos ?
- traits::rfind_separator (*p_) /* Rigtmost component */ :
- --e_ > 0 ? traits::rfind_separator (*p_, e_ - 1) :
- string_type::npos /* Leftmost empty component */;
-
- b_ = b_ == string_type::npos ? 0 : b_ + 1;
- }
+ b_ = e_ == string_type::npos // Last component?
+ ? traits::rfind_separator (*p_)
+ : (--e_ == 0 // First empty component?
+ ? string_type::npos
+ : traits::rfind_separator (*p_, e_ - 1));
+
+ b_ = b_ == string_type::npos // First component?
+ ? 0
+ : b_ + 1;
return *this;
}