diff options
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); |