aboutsummaryrefslogtreecommitdiff
path: root/butl
diff options
context:
space:
mode:
Diffstat (limited to 'butl')
-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;
}