diff options
author | mowgli <mowgli@yandex-team.ru> | 2022-02-10 16:49:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:25 +0300 |
commit | 89afbbe4ca0e02e386dd4df08f7945f190dc1b84 (patch) | |
tree | c4772201af6215d48734691b8796e4cfc77c2ac8 /library/cpp/string_utils/url/url.cpp | |
parent | 7510cec1516d17cbc8d7749974e36aa45f547a26 (diff) | |
download | ydb-89afbbe4ca0e02e386dd4df08f7945f190dc1b84.tar.gz |
Restoring authorship annotation for <mowgli@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/string_utils/url/url.cpp')
-rw-r--r-- | library/cpp/string_utils/url/url.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/library/cpp/string_utils/url/url.cpp b/library/cpp/string_utils/url/url.cpp index 85f4ac5d69..0744ae5640 100644 --- a/library/cpp/string_utils/url/url.cpp +++ b/library/cpp/string_utils/url/url.cpp @@ -264,17 +264,17 @@ TStringBuf GetDomain(const TStringBuf host) noexcept { } TStringBuf GetParentDomain(const TStringBuf host, size_t level) noexcept { - size_t pos = host.size(); - for (size_t i = 0; i < level; ++i) { - pos = host.rfind('.', pos); + size_t pos = host.size(); + for (size_t i = 0; i < level; ++i) { + pos = host.rfind('.', pos); if (pos == TString::npos) - return host; - } - return host.SubStr(pos + 1); -} - + return host; + } + return host.SubStr(pos + 1); +} + TStringBuf GetZone(const TStringBuf host) noexcept { - return GetParentDomain(host, 1); + return GetParentDomain(host, 1); } TStringBuf CutWWWPrefix(const TStringBuf url) noexcept { |