diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:10 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:10 +0300 |
commit | baa58daefa91fde4b4769facdbd2903763b9c6a8 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/string_utils/url/url.cpp | |
parent | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (diff) | |
download | ydb-baa58daefa91fde4b4769facdbd2903763b9c6a8.tar.gz |
Restoring authorship annotation for <danlark@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 | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/library/cpp/string_utils/url/url.cpp b/library/cpp/string_utils/url/url.cpp index 3658cfbabd..85f4ac5d69 100644 --- a/library/cpp/string_utils/url/url.cpp +++ b/library/cpp/string_utils/url/url.cpp @@ -106,7 +106,7 @@ size_t GetSchemePrefixSize(const TStringBuf url) noexcept { }; const auto& delim = *Singleton<TDelim>(); - const char* n = delim.brk(url.data(), url.end()); + const char* n = delim.brk(url.data(), url.end()); if (n + 2 >= url.end() || *n != ':' || n[1] != '/' || n[2] != '/') { return 0; @@ -140,7 +140,7 @@ static inline TStringBuf GetHostAndPortImpl(const TStringBuf url) { const char* firstNonHostCharacter = nonHostCharacters.brk(urlNoScheme.begin(), urlNoScheme.end()); if (firstNonHostCharacter != urlNoScheme.end()) { - return urlNoScheme.substr(0, firstNonHostCharacter - urlNoScheme.data()); + return urlNoScheme.substr(0, firstNonHostCharacter - urlNoScheme.data()); } return urlNoScheme; @@ -250,8 +250,8 @@ TStringBuf GetPathAndQuery(const TStringBuf url, bool trimFragment) noexcept { // this strange creature returns 2nd level domain, possibly with port TStringBuf GetDomain(const TStringBuf host) noexcept { - const char* c = !host ? host.data() : host.end() - 1; - for (bool wasPoint = false; c != host.data(); --c) { + const char* c = !host ? host.data() : host.end() - 1; + for (bool wasPoint = false; c != host.data(); --c) { if (*c == '.') { if (wasPoint) { ++c; @@ -278,7 +278,7 @@ TStringBuf GetZone(const TStringBuf host) noexcept { } TStringBuf CutWWWPrefix(const TStringBuf url) noexcept { - if (url.size() >= 4 && url[3] == '.' && !strnicmp(url.data(), "www", 3)) + if (url.size() >= 4 && url[3] == '.' && !strnicmp(url.data(), "www", 3)) return url.substr(4); return url; } @@ -362,7 +362,7 @@ static inline int Unescape(char* str) { } size_t NormalizeUrlName(char* dest, const TStringBuf source, size_t dest_size) { - if (source.empty() || source[0] == '?') + if (source.empty() || source[0] == '?') return strlcpy(dest, "/", dest_size); size_t len = Min(dest_size - 1, source.length()); memcpy(dest, source.data(), len); |