aboutsummaryrefslogtreecommitdiffstats
path: root/util/string
diff options
context:
space:
mode:
authorpaxakor <paxakor@yandex-team.ru>2022-02-10 16:47:32 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:32 +0300
commit40d35c046ee3a61ee2a581f42499c5ce56ac589a (patch)
treec0748b5dcbade83af788c0abfa89c0383d6b779c /util/string
parent7fdbed62e54b804e2c12b86a2c2bab12f61065df (diff)
downloadydb-40d35c046ee3a61ee2a581f42499c5ce56ac589a.tar.gz
Restoring authorship annotation for <paxakor@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/string')
-rw-r--r--util/string/hex.cpp2
-rw-r--r--util/string/hex.h4
-rw-r--r--util/string/type.cpp8
-rw-r--r--util/string/util.h12
-rw-r--r--util/string/vector.h2
5 files changed, 14 insertions, 14 deletions
diff --git a/util/string/hex.cpp b/util/string/hex.cpp
index 49e94a2a37..667397987f 100644
--- a/util/string/hex.cpp
+++ b/util/string/hex.cpp
@@ -37,7 +37,7 @@ void* HexDecode(const void* in, size_t len, void* ptr) {
char* out = (char*)ptr;
while (b != e) {
- *out++ = (char)String2Byte(b);
+ *out++ = (char)String2Byte(b);
b += 2;
}
diff --git a/util/string/hex.h b/util/string/hex.h
index 917aa63851..af3d2d528f 100644
--- a/util/string/hex.h
+++ b/util/string/hex.h
@@ -21,8 +21,8 @@ inline static int Char2Digit(char ch) {
}
//! Convert a hex string of exactly 2 chars to int
-/*! @example String2Byte("10") => 16 */
-inline static int String2Byte(const char* s) {
+/*! @example String2Byte("10") => 16 */
+inline static int String2Byte(const char* s) {
return Char2Digit(*s) * 16 + Char2Digit(*(s + 1));
}
diff --git a/util/string/type.cpp b/util/string/type.cpp
index fdb71c1bcd..49671c02c2 100644
--- a/util/string/type.cpp
+++ b/util/string/type.cpp
@@ -15,8 +15,8 @@ bool IsSpace(const char* s, size_t len) noexcept {
return true;
}
-template <typename TStringType>
-static bool IsNumberT(const TStringType& s) noexcept {
+template <typename TStringType>
+static bool IsNumberT(const TStringType& s) noexcept {
if (s.empty()) {
return false;
}
@@ -32,8 +32,8 @@ bool IsNumber(const TWtringBuf s) noexcept {
return IsNumberT(s);
}
-template <typename TStringType>
-static bool IsHexNumberT(const TStringType& s) noexcept {
+template <typename TStringType>
+static bool IsHexNumberT(const TStringType& s) noexcept {
if (s.empty()) {
return false;
}
diff --git a/util/string/util.h b/util/string/util.h
index c3a20dfb3c..0d77a5042b 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);
}
diff --git a/util/string/vector.h b/util/string/vector.h
index 2495ed5b64..e36c348bbe 100644
--- a/util/string/vector.h
+++ b/util/string/vector.h
@@ -113,7 +113,7 @@ inline TString JoinVectorIntoString(const TVector<T>& v, const TStringBuf delim)
template <typename T>
inline TString JoinVectorIntoString(const TVector<T>& v, size_t index, size_t count, const TStringBuf delim) {
- Y_ASSERT(index + count <= v.size() && "JoinVectorIntoString(): index or count out of range");
+ Y_ASSERT(index + count <= v.size() && "JoinVectorIntoString(): index or count out of range");
return JoinStrings(v.begin() + index, v.begin() + index + count, delim);
}