aboutsummaryrefslogtreecommitdiffstats
path: root/util/string/util.h
diff options
context:
space:
mode:
authorleo <leo@yandex-team.ru>2022-02-10 16:46:40 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:40 +0300
commit99609724f661f7e21d1cb08e8d80e87c3632fdb3 (patch)
tree49e222ea1c5804306084bb3ae065bb702625360f /util/string/util.h
parent980edcd3304699edf9d4e4d6a656e585028e2a72 (diff)
downloadydb-99609724f661f7e21d1cb08e8d80e87c3632fdb3.tar.gz
Restoring authorship annotation for <leo@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/string/util.h')
-rw-r--r--util/string/util.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/util/string/util.h b/util/string/util.h
index d423c328e6..0d77a5042b 100644
--- a/util/string/util.h
+++ b/util/string/util.h
@@ -2,10 +2,10 @@
//THIS FILE A COMPAT STUB HEADER
-#include <cstring>
+#include <cstring>
#include <cstdarg>
#include <algorithm>
-
+
#include <util/system/defaults.h>
#include <util/generic/string.h>
#include <util/generic/strbuf.h>
@@ -20,16 +20,16 @@ inline void RemoveIfLast(T& s, int c) {
const size_t length = s.length();
if (length && s[length - 1] == c)
s.remove(length - 1);
-}
-
+}
+
/// 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) {
s.append(char(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.
@@ -41,8 +41,8 @@ inline void addIfAbsent(TString& s, char lastCh1, char lastCh2) {
} else if (pos < s.length() - 1) {
addIfNotLast(s, lastCh2);
}
-}
-
+}
+
/// @}
/*