diff options
author | wiz <wiz@yandex-team.ru> | 2022-02-10 16:49:54 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:54 +0300 |
commit | 75494e834356f7a748c7193ccb6a5aa4dc981f4f (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/string_utils/url/url.cpp | |
parent | d55d2643fed42b214f3a9d1fcd5882cc246ad2ea (diff) | |
download | ydb-75494e834356f7a748c7193ccb6a5aa4dc981f4f.tar.gz |
Restoring authorship annotation for <wiz@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/string_utils/url/url.cpp')
-rw-r--r-- | library/cpp/string_utils/url/url.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/library/cpp/string_utils/url/url.cpp b/library/cpp/string_utils/url/url.cpp index 732eac5b43..85f4ac5d69 100644 --- a/library/cpp/string_utils/url/url.cpp +++ b/library/cpp/string_utils/url/url.cpp @@ -47,17 +47,17 @@ namespace { const TChar httpPrefix[] = {'h', 't', 't', 'p', ':', '/', '/', 0}; const TChar httpsPrefix[] = {'h', 't', 't', 'p', 's', ':', '/', '/', 0}; if (urlSize.Has(7) && Compare1Case2(url, httpPrefix, 7) == 0) - return 7; + return 7; if (!ignorehttps && urlSize.Has(8) && Compare1Case2(url, httpsPrefix, 8) == 0) - return 8; - return 0; + return 8; + return 0; } - + template <typename T> inline T CutHttpPrefixImpl(const T& url, bool ignorehttps) { size_t prefixSize = GetHttpPrefixSizeImpl<typename T::char_type>(url.data(), TKnownSize(url.size()), ignorehttps); - if (prefixSize) - return url.substr(prefixSize); + if (prefixSize) + return url.substr(prefixSize); return url; } } @@ -79,8 +79,8 @@ size_t GetHttpPrefixSize(const char* url, bool ignorehttps) noexcept { size_t GetHttpPrefixSize(const wchar16* url, bool ignorehttps) noexcept { return GetHttpPrefixSizeImpl<wchar16>(url, TUncheckedSize(), ignorehttps); -} - +} + size_t GetHttpPrefixSize(const TStringBuf url, bool ignorehttps) noexcept { return GetHttpPrefixSizeImpl<char>(url.data(), TKnownSize(url.size()), ignorehttps); } @@ -91,8 +91,8 @@ size_t GetHttpPrefixSize(const TWtringBuf url, bool ignorehttps) noexcept { TStringBuf CutHttpPrefix(const TStringBuf url, bool ignorehttps) noexcept { return CutHttpPrefixImpl(url, ignorehttps); -} - +} + TWtringBuf CutHttpPrefix(const TWtringBuf url, bool ignorehttps) noexcept { return CutHttpPrefixImpl(url, ignorehttps); } |