diff options
Diffstat (limited to 'zen/string_base.h')
-rwxr-xr-x | zen/string_base.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/zen/string_base.h b/zen/string_base.h index 2ec2e894..cb7ced20 100755 --- a/zen/string_base.h +++ b/zen/string_base.h @@ -573,14 +573,14 @@ template <class InputIterator> inline Zbase<Char, SP>& Zbase<Char, SP>::append(InputIterator first, InputIterator last) { const size_t len = std::distance(first, last); - if (len > 0) //avoid making this string unshared for no reason - { - const size_t thisLen = length(); - reserve(thisLen + len); //make unshared and check capacity - - *std::copy(first, last, rawStr_ + thisLen) = 0; - this->setLength(rawStr_, thisLen + len); - } + if (len > 0) //avoid making this string unshared for no reason + { + const size_t thisLen = length(); + reserve(thisLen + len); //make unshared and check capacity + + *std::copy(first, last, rawStr_ + thisLen) = 0; + this->setLength(rawStr_, thisLen + len); + } return *this; } |