diff options
author | maslov <maslov@yandex-team.ru> | 2022-02-10 16:48:18 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:18 +0300 |
commit | 9dc6a7dc845164ea1999b93fab2a8b7491a08d2b (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /library | |
parent | 7429d8be0f619d00069466e159d8ecd43a60f61a (diff) | |
download | ydb-9dc6a7dc845164ea1999b93fab2a8b7491a08d2b.tar.gz |
Restoring authorship annotation for <maslov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library')
-rw-r--r-- | library/cpp/cgiparam/cgiparam.cpp | 24 | ||||
-rw-r--r-- | library/cpp/cgiparam/cgiparam.h | 10 | ||||
-rw-r--r-- | library/cpp/containers/atomizer/atomizer.h | 2 | ||||
-rw-r--r-- | library/cpp/string_utils/quote/quote.cpp | 12 |
4 files changed, 24 insertions, 24 deletions
diff --git a/library/cpp/cgiparam/cgiparam.cpp b/library/cpp/cgiparam/cgiparam.cpp index 948f1060c3..f3277b8e4b 100644 --- a/library/cpp/cgiparam/cgiparam.cpp +++ b/library/cpp/cgiparam/cgiparam.cpp @@ -28,8 +28,8 @@ bool TCgiParameters::Erase(const TStringBuf name, size_t pos) { } return false; -} - +} + bool TCgiParameters::Erase(const TStringBuf name, const TStringBuf val) { const auto pair = equal_range(name); @@ -82,17 +82,17 @@ void TCgiParameters::JoinUnescaped(const TStringBuf key, char sep, TStringBuf va static inline TString DoUnescape(const TStringBuf s) { TString res; - + res.reserve(CgiUnescapeBufLen(s.size())); res.ReserveAndResize(CgiUnescape(res.begin(), s).size()); return res; } - + void TCgiParameters::InsertEscaped(const TStringBuf name, const TStringBuf value) { InsertUnescaped(DoUnescape(name), DoUnescape(value)); } - + template <bool addAll, class F> static inline void DoScan(const TStringBuf s, F& f) { ScanKeyValue<addAll, '&', '='>(s, f); @@ -115,8 +115,8 @@ void TCgiParameters::ScanAdd(const TStringBuf query) { TAddEscaped f = {this}; DoScan<false>(query, f); -} - +} + void TCgiParameters::ScanAddUnescaped(const TStringBuf query) { auto f = [this](const TStringBuf key, const TStringBuf val) { this->InsertUnescaped(key, val); @@ -147,8 +147,8 @@ TString TCgiParameters::Print() const { res.ReserveAndResize(end - res.data()); return res; -} - +} + char* TCgiParameters::Print(char* res) const { if (empty()) { return res; @@ -214,8 +214,8 @@ TCgiParameters::const_iterator TCgiParameters::Find(const TStringBuf name, size_ } return end(); -} - +} + bool TCgiParameters::Has(const TStringBuf name, const TStringBuf value) const noexcept { const auto pair = equal_range(name); @@ -226,7 +226,7 @@ bool TCgiParameters::Has(const TStringBuf name, const TStringBuf value) const no } return false; -} +} TQuickCgiParam::TQuickCgiParam(const TStringBuf cgiParamStr) { UnescapeBuf.reserve(CgiUnescapeBufLen(cgiParamStr.size())); diff --git a/library/cpp/cgiparam/cgiparam.h b/library/cpp/cgiparam/cgiparam.h index 2abb4989a6..87d1ab0ad4 100644 --- a/library/cpp/cgiparam/cgiparam.h +++ b/library/cpp/cgiparam/cgiparam.h @@ -1,5 +1,5 @@ #pragma once - + #include <library/cpp/iterator/iterate_values.h> #include <util/generic/iterator_range.h> @@ -19,17 +19,17 @@ struct TStringLess { class TCgiParameters: public TMultiMap<TString, TString> { public: TCgiParameters() = default; - + explicit TCgiParameters(const TStringBuf cgiParamStr) { Scan(cgiParamStr); } - + TCgiParameters(std::initializer_list<std::pair<TString, TString>> il); void Flush() { erase(begin(), end()); } - + size_t EraseAll(const TStringBuf name); size_t NumOfValues(const TStringBuf name) const noexcept { @@ -131,7 +131,7 @@ public: return it->second.data(); } -}; +}; template <typename TIter> void TCgiParameters::ReplaceUnescaped(const TStringBuf key, TIter valuesBegin, const TIter valuesEnd) { diff --git a/library/cpp/containers/atomizer/atomizer.h b/library/cpp/containers/atomizer/atomizer.h index 5fa2764b3a..5e40f47ab9 100644 --- a/library/cpp/containers/atomizer/atomizer.h +++ b/library/cpp/containers/atomizer/atomizer.h @@ -64,7 +64,7 @@ public: return (ui32)(*ins.first).second; // == size()+1 } ui32 find_atom(const char* key) const { - const_iterator it = find(key); + const_iterator it = find(key); if (it == end()) return 0; // INVALID_ATOM else diff --git a/library/cpp/string_utils/quote/quote.cpp b/library/cpp/string_utils/quote/quote.cpp index 2f1a26a0ee..e523350b80 100644 --- a/library/cpp/string_utils/quote/quote.cpp +++ b/library/cpp/string_utils/quote/quote.cpp @@ -3,7 +3,7 @@ #include <util/memory/tempbuf.h> #include <util/string/ascii.h> #include <util/string/cstriter.h> - + #include <cctype> /* note: (x & 0xdf) makes x upper case */ @@ -34,7 +34,7 @@ namespace { GETXC; return c; } - + static inline char x2c(TStringBuf& x) { if (!IsAsciiHex((ui8)x[0]) || !IsAsciiHex((ui8)x[1])) return '%'; @@ -66,8 +66,8 @@ namespace { static inline char d2x(unsigned x) { return (char)((x < 10) ? ('0' + x) : ('A' + x - 10)); -} - +} + static inline const char* FixZero(const char* s) noexcept { return s ? s : ""; } @@ -120,7 +120,7 @@ static inline It1 Escape(It1 to, It2 from, It3 end, const bool* escape_map = cha *to = 0; return to; -} +} template <class It1, class It2, class It3, class FromHex> static inline It1 Unescape(It1 to, It2 from, It3 end, FromHex fromHex) { @@ -161,7 +161,7 @@ void CGIEscape(TString& url) { url.AssignNoAlias(to, CGIEscape(to, url.data(), url.size())); } - + TString CGIEscapeRet(const TStringBuf url) { TString to; to.ReserveAndResize(CgiEscapeBufLen(url.size())); |