diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-07-20 19:03:09 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-07-20 19:03:09 +0200 |
commit | 9565dd32bbd68d2fada2fbe2ece4b778b43e6bb0 (patch) | |
tree | 7c3ed171875d8e5e06e4ca5018c6cba389393d48 /butl/path | |
parent | f9b7927440b89768613b7247e008efa574a6b38b (diff) |
Minor/cosmetic changes to path::operator--()
Diffstat (limited to 'butl/path')
-rw-r--r-- | butl/path | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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; } |