aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/uri
diff options
context:
space:
mode:
authordanlark <danlark@yandex-team.ru>2022-02-10 16:46:10 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:10 +0300
commitbaa58daefa91fde4b4769facdbd2903763b9c6a8 (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/uri
parent3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (diff)
downloadydb-baa58daefa91fde4b4769facdbd2903763b9c6a8.tar.gz
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/uri')
-rw-r--r--library/cpp/uri/assign.cpp24
-rw-r--r--library/cpp/uri/common.cpp2
-rw-r--r--library/cpp/uri/other.h6
-rw-r--r--library/cpp/uri/uri.cpp22
-rw-r--r--library/cpp/uri/uri.h4
5 files changed, 29 insertions, 29 deletions
diff --git a/library/cpp/uri/assign.cpp b/library/cpp/uri/assign.cpp
index 3ef124e9cc..ae9125c727 100644
--- a/library/cpp/uri/assign.cpp
+++ b/library/cpp/uri/assign.cpp
@@ -120,7 +120,7 @@ namespace NUri {
}
static inline bool AppendField(TMemoryWriteBuffer& out, TField::EField fld, const TStringBuf& val, long flags) {
- if (val.empty())
+ if (val.empty())
return false;
if (flags & TFeature::FeaturesAllEncoder)
TUri::ReEncodeField(out, val, fld, flags);
@@ -140,7 +140,7 @@ namespace NUri {
const TSchemeInfo& schemeInfo = SetSchemeImpl(parser.Scheme);
// set the scheme always if available
- if (schemeInfo.Str.empty() && scheme.IsSet())
+ if (schemeInfo.Str.empty() && scheme.IsSet())
FldSet(FieldScheme, scheme.Get());
if (ParsedOK != ret)
@@ -171,7 +171,7 @@ namespace NUri {
else
hostascii = HostToAscii(hostbuf, hostptr, allowIDN, parser.Enc);
- if (hostascii.empty())
+ if (hostascii.empty())
ret = ParsedBadHost; // exists but cannot be converted
else if (hostbuf.data() != hostascii.data()) {
hostConverted = true;
@@ -209,7 +209,7 @@ namespace NUri {
if (0 == (parser.Flags & FeatureHashBangToEscapedFragment))
break;
const TStringBuf fragbuf = frag.Get();
- if (fragbuf.empty() || '!' != fragbuf[0])
+ if (fragbuf.empty() || '!' != fragbuf[0])
break;
encHashBangFrag = true;
// '!' will make space for '&' or '\0' if needed
@@ -263,10 +263,10 @@ namespace NUri {
if (qryEscapedFragment.IsInited()) {
const EField dstfld = FieldFrag; // that's where we will store
out << '!';
- if (!qryEscapedFragment.empty())
+ if (!qryEscapedFragment.empty())
ReEncodeToField(out, qryEscapedFragment, fld, FeatureDecodeANY | careFlags, dstfld, FeatureDecodeANY | parser.GetFieldFlags(dstfld));
FldSetNoDirty(dstfld, TStringBuf(beg, out.Buf()));
- if (qryBeforeEscapedFragment.empty())
+ if (qryBeforeEscapedFragment.empty())
continue;
out << '\0';
beg = out.Buf();
@@ -336,7 +336,7 @@ namespace NUri {
CheckMissingFields();
const TStringBuf& port = GetField(FieldPort);
- if (!port.empty()) {
+ if (!port.empty()) {
if (!TryFromString<ui16>(port, Port))
ret = ParsedBadPort;
}
@@ -350,9 +350,9 @@ namespace NUri {
do {
if (0 == (flags & FeatureCheckHost))
break;
- if (hostascii.empty())
+ if (hostascii.empty())
hostascii = GetField(FieldHost);
- if (hostascii.empty())
+ if (hostascii.empty())
break;
// IP literal
if ('[' == hostascii[0] && ']' == hostascii.back())
@@ -368,7 +368,7 @@ namespace NUri {
TState::EParsed TUri::ParseImpl(const TStringBuf& url, const TParseFlags& flags, ui32 maxlen, TScheme::EKind defscheme, ECharset enc) {
Clear();
- if (url.empty())
+ if (url.empty())
return ParsedEmpty;
if (maxlen > 0 && url.length() > maxlen)
@@ -381,11 +381,11 @@ namespace NUri {
TState::EParsed TUri::Parse(const TStringBuf& url, const TParseFlags& flags, const TStringBuf& url_base, ui32 maxlen, ECharset enc) {
const TParseFlags flags1 = flags.Exclude(FeatureNoRelPath);
- TState::EParsed ret = ParseImpl(url, url_base.empty() ? flags : flags1, maxlen, SchemeEmpty, enc);
+ TState::EParsed ret = ParseImpl(url, url_base.empty() ? flags : flags1, maxlen, SchemeEmpty, enc);
if (ParsedOK != ret)
return ret;
- if (!url_base.empty() && !IsValidAbs()) {
+ if (!url_base.empty() && !IsValidAbs()) {
TUri base;
ret = base.ParseImpl(url_base, flags, maxlen, SchemeEmpty, enc);
if (ParsedOK != ret)
diff --git a/library/cpp/uri/common.cpp b/library/cpp/uri/common.cpp
index 0c683216f9..05af1e57d1 100644
--- a/library/cpp/uri/common.cpp
+++ b/library/cpp/uri/common.cpp
@@ -107,7 +107,7 @@ namespace NUri {
const char* SchemeKindToString(const TScheme::EKind& t) {
const TSchemeInfo& info = TSchemeInfo::Get(t);
- if (!info.Str.empty())
+ if (!info.Str.empty())
return info.Str.data();
return TScheme::SchemeEmpty == t ? "empty" : "unknown";
}
diff --git a/library/cpp/uri/other.h b/library/cpp/uri/other.h
index c0d8b583b2..7aec22e77b 100644
--- a/library/cpp/uri/other.h
+++ b/library/cpp/uri/other.h
@@ -15,7 +15,7 @@ void UnTrspChars(const char* s, char* d);
void InvertDomain(char* begin, char* end);
inline TString& InvertDomain(TString& url) {
- InvertDomain(url.begin(), url.begin() + url.size());
+ InvertDomain(url.begin(), url.begin() + url.size());
return url;
}
@@ -26,7 +26,7 @@ inline void InvertUrl(char* url) {
}
inline TString& InvertUrl(TString& url) {
- InvertUrl(url.begin(), url.begin() + url.size());
+ InvertUrl(url.begin(), url.begin() + url.size());
return url;
}
@@ -37,6 +37,6 @@ inline void RevertUrl(char* url) {
}
inline TString& RevertUrl(TString& url) {
- RevertUrl(url.begin(), url.begin() + url.size());
+ RevertUrl(url.begin(), url.begin() + url.size());
return url;
}
diff --git a/library/cpp/uri/uri.cpp b/library/cpp/uri/uri.cpp
index 4383c0ffe7..56a9a4e5ef 100644
--- a/library/cpp/uri/uri.cpp
+++ b/library/cpp/uri/uri.cpp
@@ -7,7 +7,7 @@
namespace NUri {
TState::EParsed TUri::CheckHost(const TStringBuf& host) {
- if (host.empty())
+ if (host.empty())
return ParsedOK;
unsigned domainLevel = 0;
@@ -62,8 +62,8 @@ namespace NUri {
, Scheme(SchemeEmpty)
, FieldsDirty(0)
{
- if (!scheme.empty()) {
- if (SetSchemeImpl(TSchemeInfo::Get(scheme)).Str.empty())
+ if (!scheme.empty()) {
+ if (SetSchemeImpl(TSchemeInfo::Get(scheme)).Str.empty())
FldSet(FieldScheme, scheme);
}
@@ -91,12 +91,12 @@ namespace NUri {
switch (field) {
case FieldScheme:
- if (!SetScheme(TSchemeInfo::Get(value)).Str.empty())
+ if (!SetScheme(TSchemeInfo::Get(value)).Str.empty())
return false;
break;
case FieldPort:
- Port = value.empty() ? 0 : FromString<ui16>(value);
+ Port = value.empty() ? 0 : FromString<ui16>(value);
break;
default:
@@ -213,7 +213,7 @@ namespace NUri {
static constexpr TStringBuf rootPath = "/";
if (noscheme) {
- if (!basescheme.empty()) {
+ if (!basescheme.empty()) {
FldSetNoDirty(FieldScheme, basescheme);
// check if it is canonical
if (basescheme.data() != base.GetSchemeInfo().Str.data())
@@ -296,7 +296,7 @@ namespace NUri {
// merge with base URL
// taken either from _BASE_ property or from optional argument
- if (!codebase.empty()) {
+ if (!codebase.empty()) {
// if optional code base given -- parse it
TUri codebaseUrl;
if (codebaseUrl.ParseImpl(codebase, careFlags, 0, SchemeEmpty, enc) != ParsedOK || !codebaseUrl.IsValidAbs())
@@ -312,7 +312,7 @@ namespace NUri {
if (!IsValidAbs())
return LinkBadAbs;
- if (!host.empty()) {
+ if (!host.empty()) {
// - we don't care about different ports for the same server
// - we don't care about win|www|koi|etc. preffixes for the same server
if (GetPort() != base.GetPort() || !EqualNoCase(host, base.GetHost()))
@@ -359,7 +359,7 @@ namespace NUri {
if (flags & FlagScheme) {
v = Fields[FieldScheme];
- if (!v.empty())
+ if (!v.empty())
out << v << ':';
}
@@ -381,7 +381,7 @@ namespace NUri {
if (flags & FlagAuth) {
if (flags & FlagUser) {
v = Fields[FieldUser];
- if (!v.empty())
+ if (!v.empty())
TEncoder::EncodeNotAlnum(out, v);
}
@@ -407,7 +407,7 @@ namespace NUri {
if (flags & FlagPath) {
v = Fields[FieldPath];
// for relative, empty path is not the same as missing
- if (v.empty() && 0 == (flags & FlagHost))
+ if (v.empty() && 0 == (flags & FlagHost))
v = TStringBuf(".");
out << v;
}
diff --git a/library/cpp/uri/uri.h b/library/cpp/uri/uri.h
index e6b41009c5..3b6c19fe4a 100644
--- a/library/cpp/uri/uri.h
+++ b/library/cpp/uri/uri.h
@@ -566,7 +566,7 @@ namespace NUri {
const TSchemeInfo& SetSchemeImpl(const TSchemeInfo& info) {
Scheme = info.Kind;
DefaultPort = info.Port;
- if (!info.Str.empty())
+ if (!info.Str.empty())
FldSetNoDirty(FieldScheme, info.Str);
return info;
}
@@ -577,7 +577,7 @@ namespace NUri {
public:
const TSchemeInfo& SetScheme(const TSchemeInfo& info) {
SetSchemeImpl(info);
- if (!info.Str.empty())
+ if (!info.Str.empty())
FldMarkClean(FieldScheme);
return info;
}