From f206f4d5846545715fd46266938ba92bc49b522d Mon Sep 17 00:00:00 2001 From: babenko Date: Mon, 12 May 2025 17:06:01 +0300 Subject: YT-22593: Migrate HTTP headers to std::string [diff:runtime] commit_hash:262b2e671526b138d7a9631daf5d34400fc2208c --- library/cpp/yt/string/string.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'library/cpp/yt/string/string.cpp') 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(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)); } //////////////////////////////////////////////////////////////////////////////// -- cgit v1.3