diff options
author | muzich <muzich@yandex-team.ru> | 2022-02-10 16:49:55 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:55 +0300 |
commit | c1979c2381cc77360b23e68225994f4b343e5acc (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 | |
parent | bf6bd1f317019d83a3f8d5d39c2d0e9d6d705e40 (diff) | |
download | ydb-c1979c2381cc77360b23e68225994f4b343e5acc.tar.gz |
Restoring authorship annotation for <muzich@yandex-team.ru>. Commit 2 of 2.
-rw-r--r-- | library/cpp/charset/wide.h | 16 | ||||
-rw-r--r-- | library/cpp/json/writer/json_value.cpp | 4 | ||||
-rw-r--r-- | library/cpp/json/writer/json_value.h | 2 | ||||
-rw-r--r-- | library/cpp/string_utils/url/url.cpp | 16 | ||||
-rw-r--r-- | library/cpp/string_utils/url/url.h | 6 |
5 files changed, 22 insertions, 22 deletions
diff --git a/library/cpp/charset/wide.h b/library/cpp/charset/wide.h index 6da96c3b30..32d30e849e 100644 --- a/library/cpp/charset/wide.h +++ b/library/cpp/charset/wide.h @@ -184,7 +184,7 @@ namespace NDetail { // special implementation for robust utf8 functions template <typename TResult> - TWtringBuf RecodeUTF8Robust(const TStringBuf src, TResult& dst) { + TWtringBuf RecodeUTF8Robust(const TStringBuf src, TResult& dst) { // make enough room for re-coded string wchar16* dstbuf = TRecodeResultOps<TResult>::Reserve(dst, src.size() * TRecodeTraits<wchar16>::ReserveSize); @@ -208,17 +208,17 @@ namespace NDetail { // Write result into @dst. Return string-buffer pointing to re-coded content of @dst. template <bool robust> -inline TWtringBuf CharToWide(const TStringBuf src, TUtf16String& dst, ECharset encoding) { +inline TWtringBuf CharToWide(const TStringBuf src, TUtf16String& dst, ECharset encoding) { if (robust && CODES_UTF8 == encoding) return ::NDetail::RecodeUTF8Robust(src, dst); return ::NDetail::Recode<char>(src, dst, encoding); } -inline TWtringBuf CharToWide(const TStringBuf src, TUtf16String& dst, ECharset encoding) { +inline TWtringBuf CharToWide(const TStringBuf src, TUtf16String& dst, ECharset encoding) { return ::NDetail::Recode<char>(src, dst, encoding); } -inline TStringBuf WideToChar(const TWtringBuf src, TString& dst, ECharset encoding) { +inline TStringBuf WideToChar(const TWtringBuf src, TString& dst, ECharset encoding) { return ::NDetail::Recode<wchar16>(src, dst, encoding); } @@ -284,20 +284,20 @@ inline TUtf16String UTF8ToWide(const char* text, size_t len, const CodePage& cp) return w; } -inline TString WideToChar(const TWtringBuf w, ECharset enc) { +inline TString WideToChar(const TWtringBuf w, ECharset enc) { return WideToChar(w.data(), w.size(), enc); } -inline TUtf16String CharToWide(const TStringBuf s, ECharset enc) { +inline TUtf16String CharToWide(const TStringBuf s, ECharset enc) { return CharToWide<false>(s.data(), s.size(), enc); } template <bool robust> -inline TUtf16String CharToWide(const TStringBuf s, ECharset enc) { +inline TUtf16String CharToWide(const TStringBuf s, ECharset enc) { return CharToWide<robust>(s.data(), s.size(), enc); } -inline TUtf16String CharToWide(const TStringBuf s, const CodePage& cp) { +inline TUtf16String CharToWide(const TStringBuf s, const CodePage& cp) { return CharToWide(s.data(), s.size(), cp); } diff --git a/library/cpp/json/writer/json_value.cpp b/library/cpp/json/writer/json_value.cpp index 7862f4bfa3..c61e8d1dc4 100644 --- a/library/cpp/json/writer/json_value.cpp +++ b/library/cpp/json/writer/json_value.cpp @@ -895,11 +895,11 @@ namespace NJson { if (Type == JSON_MAP) { for (auto&& i : *Value.Map) { - i.second.DoScan(!!path ? TString::Join(path, ".", i.first) : i.first, this, callback); + i.second.DoScan(!!path ? TString::Join(path, ".", i.first) : i.first, this, callback); } } else if (Type == JSON_ARRAY) { for (ui32 i = 0; i < Value.Array->size(); ++i) { - (*Value.Array)[i].DoScan(TString::Join(path, "[", ToString(i), "]"), this, callback); + (*Value.Array)[i].DoScan(TString::Join(path, "[", ToString(i), "]"), this, callback); } } } diff --git a/library/cpp/json/writer/json_value.h b/library/cpp/json/writer/json_value.h index 5c490c5805..3f0f50bc4c 100644 --- a/library/cpp/json/writer/json_value.h +++ b/library/cpp/json/writer/json_value.h @@ -26,7 +26,7 @@ namespace NJson { class IScanCallback { public: - virtual ~IScanCallback() = default; + virtual ~IScanCallback() = default; virtual bool Do(const TString& path, TJsonValue* parent, TJsonValue& value) = 0; }; diff --git a/library/cpp/string_utils/url/url.cpp b/library/cpp/string_utils/url/url.cpp index dfc33d811d..85f4ac5d69 100644 --- a/library/cpp/string_utils/url/url.cpp +++ b/library/cpp/string_utils/url/url.cpp @@ -314,7 +314,7 @@ static inline bool IsSchemeChar(char c) noexcept { return IsAsciiAlnum(c); //what about '+' ?.. } -static bool HasPrefix(const TStringBuf url) noexcept { +static bool HasPrefix(const TStringBuf url) noexcept { TStringBuf scheme, unused; if (!url.TrySplit(TStringBuf("://"), scheme, unused)) return false; @@ -326,7 +326,7 @@ TString AddSchemePrefix(const TString& url) { return AddSchemePrefix(url, TStringBuf("http")); } -TString AddSchemePrefix(const TString& url, TStringBuf scheme) { +TString AddSchemePrefix(const TString& url, TStringBuf scheme) { if (HasPrefix(url)) { return url; } @@ -387,13 +387,13 @@ size_t NormalizeHostName(char* dest, const TStringBuf source, size_t dest_size, strlwr(dest); return len; } - + TStringBuf RemoveFinalSlash(TStringBuf str) noexcept { - if (str.EndsWith('/')) { - str.Chop(1); - } - return str; -} + if (str.EndsWith('/')) { + str.Chop(1); + } + return str; +} TStringBuf CutUrlPrefixes(TStringBuf url) noexcept { url = CutSchemePrefix(url); diff --git a/library/cpp/string_utils/url/url.h b/library/cpp/string_utils/url/url.h index 14e43edbfb..84137ccc57 100644 --- a/library/cpp/string_utils/url/url.h +++ b/library/cpp/string_utils/url/url.h @@ -58,7 +58,7 @@ TStringBuf CutSchemePrefix(const TStringBuf url) noexcept; //! adds specified scheme prefix if URL has no scheme //! @note if URL has scheme prefix already the function returns unchanged URL -TString AddSchemePrefix(const TString& url, const TStringBuf scheme); +TString AddSchemePrefix(const TString& url, const TStringBuf scheme); //! Same as `AddSchemePrefix(url, "http")`. TString AddSchemePrefix(const TString& url); @@ -161,10 +161,10 @@ TStringBuf GetDomain(const TStringBuf host) noexcept; // should not be used size_t NormalizeUrlName(char* dest, const TStringBuf source, size_t dest_size); size_t NormalizeHostName(char* dest, const TStringBuf source, size_t dest_size, ui16 defport = 80); - + Y_PURE_FUNCTION TStringBuf RemoveFinalSlash(TStringBuf str) noexcept; - + TStringBuf CutUrlPrefixes(TStringBuf url) noexcept; bool DoesUrlPathStartWithToken(TStringBuf url, const TStringBuf& token) noexcept; |