diff options
author | cobat <cobat@yandex-team.ru> | 2022-02-10 16:49:07 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:07 +0300 |
commit | 1d2e8a8e9976488ea69a7e4763aa749244f82612 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/string/util.h | |
parent | e486e109b08823b61996f2154f0bc6b7c27a4af4 (diff) | |
download | ydb-1d2e8a8e9976488ea69a7e4763aa749244f82612.tar.gz |
Restoring authorship annotation for <cobat@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/string/util.h')
-rw-r--r-- | util/string/util.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/util/string/util.h b/util/string/util.h index a958a7a1a40..0d77a5042b8 100644 --- a/util/string/util.h +++ b/util/string/util.h @@ -14,7 +14,7 @@ /// @{ int a2i(const TString& s); -/// Removes the last character if it is equal to c. +/// Removes the last character if it is equal to c. template <class T> inline void RemoveIfLast(T& s, int c) { const size_t length = s.length(); @@ -22,7 +22,7 @@ inline void RemoveIfLast(T& s, int c) { s.remove(length - 1); } -/// Adds lastCh symbol to the the of the string if it is not already there. +/// Adds lastCh symbol to the the of the string if it is not already there. inline void addIfNotLast(TString& s, int lastCh) { size_t len = s.length(); if (!len || s[len - 1] != lastCh) { @@ -30,9 +30,9 @@ inline void addIfNotLast(TString& s, int lastCh) { } } -/// @details Finishes the string with lastCh1 if lastCh2 is not present in the string and lastCh1 is not already at the end of the string. -/// Else, if lastCh2 is not equal to the symbol before the last, it finishes the string with lastCh2. -/// @todo ?? Define, when to apply the function. Is in use several times for URLs parsing. +/// @details Finishes the string with lastCh1 if lastCh2 is not present in the string and lastCh1 is not already at the end of the string. +/// Else, if lastCh2 is not equal to the symbol before the last, it finishes the string with lastCh2. +/// @todo ?? Define, when to apply the function. Is in use several times for URLs parsing. inline void addIfAbsent(TString& s, char lastCh1, char lastCh2) { size_t pos = s.find(lastCh2); if (pos == TString::npos) { |