diff options
author | paxakor <paxakor@yandex-team.ru> | 2022-02-10 16:47:32 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:32 +0300 |
commit | 40d35c046ee3a61ee2a581f42499c5ce56ac589a (patch) | |
tree | c0748b5dcbade83af788c0abfa89c0383d6b779c /util/string/util.h | |
parent | 7fdbed62e54b804e2c12b86a2c2bab12f61065df (diff) | |
download | ydb-40d35c046ee3a61ee2a581f42499c5ce56ac589a.tar.gz |
Restoring authorship annotation for <paxakor@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/string/util.h')
-rw-r--r-- | util/string/util.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/util/string/util.h b/util/string/util.h index c3a20dfb3cf..0d77a5042b8 100644 --- a/util/string/util.h +++ b/util/string/util.h @@ -182,14 +182,14 @@ private: }; // Removes all occurrences of given character from string -template <typename TStringType> -void RemoveAll(TStringType& str, typename TStringType::char_type ch) { +template <typename TStringType> +void RemoveAll(TStringType& str, typename TStringType::char_type ch) { size_t pos = str.find(ch); // 'find' to avoid cloning of string in 'TString.begin()' - if (pos == TStringType::npos) + if (pos == TStringType::npos) return; - typename TStringType::iterator begin = str.begin(); - typename TStringType::iterator end = begin + str.length(); - typename TStringType::iterator it = std::remove(begin + pos, end, ch); + typename TStringType::iterator begin = str.begin(); + typename TStringType::iterator end = begin + str.length(); + typename TStringType::iterator it = std::remove(begin + pos, end, ch); str.erase(it, end); } |