diff options
| author | babenko <[email protected]> | 2025-05-12 17:06:01 +0300 |
|---|---|---|
| committer | babenko <[email protected]> | 2025-05-12 17:41:42 +0300 |
| commit | f206f4d5846545715fd46266938ba92bc49b522d (patch) | |
| tree | cd2b8d1c97985a4e7ae07bc8bcf71684e5e2bffb /library/cpp/yt/string/string.cpp | |
| parent | f74154ede8129273b38c341aabf3857b4f3faff7 (diff) | |
YT-22593: Migrate HTTP headers to std::string
[diff:runtime]
commit_hash:262b2e671526b138d7a9631daf5d34400fc2208c
Diffstat (limited to 'library/cpp/yt/string/string.cpp')
| -rw-r--r-- | library/cpp/yt/string/string.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/library/cpp/yt/string/string.cpp b/library/cpp/yt/string/string.cpp index ed51f453fb6..7d58d474382 100644 --- a/library/cpp/yt/string/string.cpp +++ b/library/cpp/yt/string/string.cpp @@ -65,17 +65,17 @@ TString CamelCaseToUnderscoreCase(TStringBuf str) //////////////////////////////////////////////////////////////////////////////// -TString TrimLeadingWhitespaces(const TString& str) +TString TrimLeadingWhitespaces(TStringBuf str) { - for (int i = 0; i < static_cast<int>(str.size()); ++i) { + for (size_t i = 0; i < str.size(); ++i) { if (str[i] != ' ') { - return str.substr(i); + return TString(str.substr(i)); } } return ""; } -TString Trim(const TString& str, const TString& whitespaces) +TString Trim(TStringBuf str, TStringBuf whitespaces) { size_t end = str.size(); while (end > 0) { @@ -100,7 +100,7 @@ TString Trim(const TString& str, const TString& whitespaces) size_t begin = str.find_first_not_of(whitespaces); YT_VERIFY(begin != TString::npos); YT_VERIFY(begin < end); - return str.substr(begin, end - begin); + return TString(str.substr(begin, end - begin)); } //////////////////////////////////////////////////////////////////////////////// |
