diff options
author | yuraaka <yuraaka@yandex-team.ru> | 2022-02-10 16:47:05 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:05 +0300 |
commit | 5577dc406121f6fb3f45b227c01f4251880193a1 (patch) | |
tree | b83306b6e37edeea782e9eed673d89286c4fef35 /library | |
parent | 4230543261d7a38ef4dc14785ae0d45f2da43704 (diff) | |
download | ydb-5577dc406121f6fb3f45b227c01f4251880193a1.tar.gz |
Restoring authorship annotation for <yuraaka@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library')
-rw-r--r-- | library/cpp/containers/flat_hash/flat_hash.h | 42 | ||||
-rw-r--r-- | library/cpp/containers/flat_hash/lib/containers.h | 60 | ||||
-rw-r--r-- | library/cpp/containers/flat_hash/lib/map.h | 6 | ||||
-rw-r--r-- | library/cpp/containers/flat_hash/lib/set.h | 6 | ||||
-rw-r--r-- | library/cpp/containers/flat_hash/lib/table.h | 6 | ||||
-rw-r--r-- | library/cpp/containers/flat_hash/ut/flat_hash_ut.cpp | 60 | ||||
-rw-r--r-- | library/cpp/getopt/small/last_getopt_opts.h | 38 | ||||
-rw-r--r-- | library/cpp/getopt/small/last_getopt_parse_result.cpp | 20 | ||||
-rw-r--r-- | library/cpp/getopt/ut/last_getopt_ut.cpp | 24 | ||||
-rw-r--r-- | library/cpp/http/io/headers.cpp | 12 | ||||
-rw-r--r-- | library/cpp/http/io/headers.h | 10 | ||||
-rw-r--r-- | library/cpp/http/io/headers_ut.cpp | 20 | ||||
-rw-r--r-- | library/cpp/http/server/http.cpp | 8 | ||||
-rw-r--r-- | library/cpp/http/server/options.h | 14 | ||||
-rw-r--r-- | library/cpp/string_utils/base64/base64_decode_uneven_ut.cpp | 2 |
15 files changed, 164 insertions, 164 deletions
diff --git a/library/cpp/containers/flat_hash/flat_hash.h b/library/cpp/containers/flat_hash/flat_hash.h index b938c94c8a..582b8ae8f5 100644 --- a/library/cpp/containers/flat_hash/flat_hash.h +++ b/library/cpp/containers/flat_hash/flat_hash.h @@ -11,31 +11,31 @@ namespace NPrivate { -template <class Key, class T, class Hash, class KeyEqual, class Probing, class Alloc> +template <class Key, class T, class Hash, class KeyEqual, class Probing, class Alloc> using TFlatHashMapImpl = NFlatHash::TMap<Key, T, Hash, KeyEqual, - NFlatHash::TFlatContainer<std::pair<const Key, T>, Alloc>, + NFlatHash::TFlatContainer<std::pair<const Key, T>, Alloc>, Probing, NFlatHash::TAndSizeFitter, NFlatHash::TSimpleExpander>; -template <class Key, class T, auto emptyMarker, class Hash, class KeyEqual, class Probing, class Alloc> +template <class Key, class T, auto emptyMarker, class Hash, class KeyEqual, class Probing, class Alloc> using TDenseHashMapImpl = NFlatHash::TMap<Key, T, Hash, KeyEqual, NFlatHash::TDenseContainer<std::pair<const Key, T>, - NFlatHash::NMap::TStaticValueMarker<emptyMarker, T>, - Alloc>, + NFlatHash::NMap::TStaticValueMarker<emptyMarker, T>, + Alloc>, Probing, NFlatHash::TAndSizeFitter, NFlatHash::TSimpleExpander>; -template <class T, class Hash, class KeyEqual, class Probing, class Alloc> +template <class T, class Hash, class KeyEqual, class Probing, class Alloc> using TFlatHashSetImpl = NFlatHash::TSet<T, Hash, KeyEqual, - NFlatHash::TFlatContainer<T, Alloc>, + NFlatHash::TFlatContainer<T, Alloc>, Probing, NFlatHash::TAndSizeFitter, NFlatHash::TSimpleExpander>; -template <class T, auto emptyMarker, class Hash, class KeyEqual, class Probing, class Alloc> +template <class T, auto emptyMarker, class Hash, class KeyEqual, class Probing, class Alloc> using TDenseHashSetImpl = NFlatHash::TSet<T, Hash, KeyEqual, - NFlatHash::TDenseContainer<T, NFlatHash::NSet::TStaticValueMarker<emptyMarker>, Alloc>, + NFlatHash::TDenseContainer<T, NFlatHash::NSet::TStaticValueMarker<emptyMarker>, Alloc>, Probing, NFlatHash::TAndSizeFitter, NFlatHash::TSimpleExpander>; } // namespace NPrivate @@ -60,9 +60,9 @@ template <class Key, class T, class Hash = THash<Key>, class KeyEqual = std::equal_to<>, - class Probing = NFlatHash::TLinearProbing, - class Alloc = std::allocator<std::pair<const Key, T>>> -using TFlatHashMap = NPrivate::TFlatHashMapImpl<Key, T, Hash, KeyEqual, Probing, Alloc>; + class Probing = NFlatHash::TLinearProbing, + class Alloc = std::allocator<std::pair<const Key, T>>> +using TFlatHashMap = NPrivate::TFlatHashMapImpl<Key, T, Hash, KeyEqual, Probing, Alloc>; /* Open addressing table with user specified marker for empty buckets. * Currently available probings: @@ -75,10 +75,10 @@ template <class Key, auto emptyMarker, class Hash = THash<Key>, class KeyEqual = std::equal_to<>, - class Probing = NFlatHash::TDenseProbing, - class Alloc = std::allocator<std::pair<const Key, T>>> + class Probing = NFlatHash::TDenseProbing, + class Alloc = std::allocator<std::pair<const Key, T>>> using TDenseHashMapStaticMarker = NPrivate::TDenseHashMapImpl<Key, T, emptyMarker, - Hash, KeyEqual, Probing, Alloc>; + Hash, KeyEqual, Probing, Alloc>; /* flat_set: Fast and highly customizable hash set. @@ -98,9 +98,9 @@ using TDenseHashMapStaticMarker = NPrivate::TDenseHashMapImpl<Key, T, emptyMarke template <class T, class Hash = THash<T>, class KeyEqual = std::equal_to<>, - class Probing = NFlatHash::TLinearProbing, - class Alloc = std::allocator<T>> -using TFlatHashSet = NPrivate::TFlatHashSetImpl<T, Hash, KeyEqual, Probing, Alloc>; + class Probing = NFlatHash::TLinearProbing, + class Alloc = std::allocator<T>> +using TFlatHashSet = NPrivate::TFlatHashSetImpl<T, Hash, KeyEqual, Probing, Alloc>; /* Open addressing table with user specified marker for empty buckets. * Currently available probings: @@ -112,9 +112,9 @@ template <class T, auto emptyMarker, class Hash = THash<T>, class KeyEqual = std::equal_to<>, - class Probing = NFlatHash::TDenseProbing, - class Alloc = std::allocator<T>> + class Probing = NFlatHash::TDenseProbing, + class Alloc = std::allocator<T>> using TDenseHashSetStaticMarker = NPrivate::TDenseHashSetImpl<T, emptyMarker, - Hash, KeyEqual, Probing, Alloc>; + Hash, KeyEqual, Probing, Alloc>; } // namespace NFH diff --git a/library/cpp/containers/flat_hash/lib/containers.h b/library/cpp/containers/flat_hash/lib/containers.h index 485eb7ae4f..82008f2f9c 100644 --- a/library/cpp/containers/flat_hash/lib/containers.h +++ b/library/cpp/containers/flat_hash/lib/containers.h @@ -15,15 +15,15 @@ namespace NFlatHash { /* FLAT CONTAINER */ -template <class T, class Alloc = std::allocator<T>> +template <class T, class Alloc = std::allocator<T>> class TFlatContainer { public: using value_type = T; using size_type = size_t; using difference_type = ptrdiff_t; - using allocator_type = Alloc; - using pointer = typename std::allocator_traits<allocator_type>::pointer; - using const_pointer = typename std::allocator_traits<allocator_type>::const_pointer; + using allocator_type = Alloc; + using pointer = typename std::allocator_traits<allocator_type>::pointer; + using const_pointer = typename std::allocator_traits<allocator_type>::const_pointer; private: class TCage { @@ -98,8 +98,8 @@ private: }; public: - explicit TFlatContainer(size_type initSize, const allocator_type& alloc = {}) - : Buckets_(initSize, alloc) + explicit TFlatContainer(size_type initSize, const allocator_type& alloc = {}) + : Buckets_(initSize, alloc) , Taken_(0) , Empty_(initSize) {} @@ -145,10 +145,10 @@ public: DoSwap(Empty_, rhs.Empty_); } - TFlatContainer Clone(size_type newSize) const { return TFlatContainer(newSize, Buckets_.get_allocator()); } + TFlatContainer Clone(size_type newSize) const { return TFlatContainer(newSize, Buckets_.get_allocator()); } private: - TVector<TCage, allocator_type> Buckets_; + TVector<TCage, allocator_type> Buckets_; size_type Taken_; size_type Empty_; }; @@ -158,7 +158,7 @@ static_assert(NConcepts::RemovalContainerV<TFlatContainer<int>>); /* DENSE CONTAINER */ -template <class T, class EmptyMarker = NSet::TEqValueMarker<T>, class Alloc = std::allocator<T>> +template <class T, class EmptyMarker = NSet::TEqValueMarker<T>, class Alloc = std::allocator<T>> class TDenseContainer { static_assert(NConcepts::ValueMarkerV<EmptyMarker>); @@ -166,13 +166,13 @@ public: using value_type = T; using size_type = size_t; using difference_type = ptrdiff_t; - using allocator_type = Alloc; - using pointer = typename std::allocator_traits<allocator_type>::pointer; - using const_pointer = typename std::allocator_traits<allocator_type>::const_pointer; + using allocator_type = Alloc; + using pointer = typename std::allocator_traits<allocator_type>::pointer; + using const_pointer = typename std::allocator_traits<allocator_type>::const_pointer; public: - TDenseContainer(size_type initSize, EmptyMarker emptyMarker = {}, const allocator_type& alloc = {}) - : Buckets_(initSize, emptyMarker.Create(), alloc) + TDenseContainer(size_type initSize, EmptyMarker emptyMarker = {}, const allocator_type& alloc = {}) + : Buckets_(initSize, emptyMarker.Create(), alloc) , Taken_(0) , EmptyMarker_(std::move(emptyMarker)) {} @@ -217,15 +217,15 @@ public: DoSwap(Taken_, rhs.Taken_); } - TDenseContainer Clone(size_type newSize) const { return { newSize, EmptyMarker_, GetAllocator() }; } + TDenseContainer Clone(size_type newSize) const { return { newSize, EmptyMarker_, GetAllocator() }; } protected: - allocator_type GetAllocator() const { - return Buckets_.get_allocator(); - } - -protected: - TVector<value_type, allocator_type> Buckets_; + allocator_type GetAllocator() const { + return Buckets_.get_allocator(); + } + +protected: + TVector<value_type, allocator_type> Buckets_; size_type Taken_; EmptyMarker EmptyMarker_; }; @@ -234,8 +234,8 @@ static_assert(NConcepts::ContainerV<TDenseContainer<int>>); static_assert(!NConcepts::RemovalContainerV<TDenseContainer<int>>); template <class T, class DeletedMarker = NSet::TEqValueMarker<T>, - class EmptyMarker = NSet::TEqValueMarker<T>, class Alloc = std::allocator<T>> -class TRemovalDenseContainer : private TDenseContainer<T, EmptyMarker, Alloc> { + class EmptyMarker = NSet::TEqValueMarker<T>, class Alloc = std::allocator<T>> +class TRemovalDenseContainer : private TDenseContainer<T, EmptyMarker, Alloc> { private: static_assert(NConcepts::ValueMarkerV<DeletedMarker>); @@ -245,17 +245,17 @@ public: using typename TBase::value_type; using typename TBase::size_type; using typename TBase::difference_type; - using typename TBase::allocator_type; - using typename TBase::pointer; - using typename TBase::const_pointer; + using typename TBase::allocator_type; + using typename TBase::pointer; + using typename TBase::const_pointer; public: TRemovalDenseContainer( size_type initSize, DeletedMarker deletedMarker = {}, - EmptyMarker emptyMarker = {}, - const allocator_type& alloc = {}) - : TBase(initSize, std::move(emptyMarker), alloc) + EmptyMarker emptyMarker = {}, + const allocator_type& alloc = {}) + : TBase(initSize, std::move(emptyMarker), alloc) , DeletedMarker_(std::move(deletedMarker)) , Empty_(initSize) {} @@ -300,7 +300,7 @@ public: } TRemovalDenseContainer Clone(size_type newSize) const { - return { newSize, DeletedMarker_, TBase::EmptyMarker_, TBase::GetAllocator() }; + return { newSize, DeletedMarker_, TBase::EmptyMarker_, TBase::GetAllocator() }; } private: diff --git a/library/cpp/containers/flat_hash/lib/map.h b/library/cpp/containers/flat_hash/lib/map.h index 14ce5f8c9b..f77c318a61 100644 --- a/library/cpp/containers/flat_hash/lib/map.h +++ b/library/cpp/containers/flat_hash/lib/map.h @@ -67,9 +67,9 @@ public: using typename TBase::const_reference; using typename TBase::iterator; using typename TBase::const_iterator; - using typename TBase::allocator_type; - using typename TBase::pointer; - using typename TBase::const_pointer; + using typename TBase::allocator_type; + using typename TBase::pointer; + using typename TBase::const_pointer; private: static constexpr size_type INIT_SIZE = 8; diff --git a/library/cpp/containers/flat_hash/lib/set.h b/library/cpp/containers/flat_hash/lib/set.h index 2694711a35..5266293c6c 100644 --- a/library/cpp/containers/flat_hash/lib/set.h +++ b/library/cpp/containers/flat_hash/lib/set.h @@ -58,9 +58,9 @@ public: using typename TBase::const_reference; using typename TBase::iterator; using typename TBase::const_iterator; - using typename TBase::allocator_type; - using typename TBase::pointer; - using typename TBase::const_pointer; + using typename TBase::allocator_type; + using typename TBase::pointer; + using typename TBase::const_pointer; private: static constexpr size_type INIT_SIZE = 8; diff --git a/library/cpp/containers/flat_hash/lib/table.h b/library/cpp/containers/flat_hash/lib/table.h index 2af81056a8..b84a052be7 100644 --- a/library/cpp/containers/flat_hash/lib/table.h +++ b/library/cpp/containers/flat_hash/lib/table.h @@ -57,9 +57,9 @@ public: using iterator = TIteratorImpl<typename IteratorModifier<Container>::type, typename IteratorModifier<value_type>::type>; using const_iterator = TIteratorImpl<const Container, const value_type>; - using allocator_type = typename Container::allocator_type; - using pointer = typename Container::pointer; - using const_pointer = typename Container::const_pointer; + using allocator_type = typename Container::allocator_type; + using pointer = typename Container::pointer; + using const_pointer = typename Container::const_pointer; private: TTable(Container buckets) diff --git a/library/cpp/containers/flat_hash/ut/flat_hash_ut.cpp b/library/cpp/containers/flat_hash/ut/flat_hash_ut.cpp index 76004649c0..2b9d6a1dc2 100644 --- a/library/cpp/containers/flat_hash/ut/flat_hash_ut.cpp +++ b/library/cpp/containers/flat_hash/ut/flat_hash_ut.cpp @@ -20,8 +20,8 @@ const std::initializer_list<std::pair<const int, TString>> MAP_INPUT_SAMPLE{ template <class Map> class TMapTest : public TTestBase { - void AllocatorTest(); - + void AllocatorTest(); + void SmokingTest() { Map mp; mp.emplace(5, "abc"); @@ -123,7 +123,7 @@ class TMapTest : public TTestBase { } UNIT_TEST_SUITE_DEMANGLE(TMapTest); - UNIT_TEST(AllocatorTest); + UNIT_TEST(AllocatorTest); UNIT_TEST(SmokingTest); UNIT_TEST(CopyConstructionTest); UNIT_TEST(MoveConstructionTest); @@ -135,18 +135,18 @@ class TMapTest : public TTestBase { UNIT_TEST_SUITE_END(); }; -template <> -void TMapTest<TFlatHashMap<int, TString>>::AllocatorTest() { - using Map = TFlatHashMap<int, TString>; - Map mp(3, typename Map::allocator_type()); -} - -template <> -void TMapTest<TDenseHashMapStaticMarker<int, TString, -1>>::AllocatorTest() { - using Map = TDenseHashMapStaticMarker<int, TString, -1>; - Map mp(3, NFlatHash::NMap::TStaticValueMarker<-1, TString>(), typename Map::allocator_type()); -} - +template <> +void TMapTest<TFlatHashMap<int, TString>>::AllocatorTest() { + using Map = TFlatHashMap<int, TString>; + Map mp(3, typename Map::allocator_type()); +} + +template <> +void TMapTest<TDenseHashMapStaticMarker<int, TString, -1>>::AllocatorTest() { + using Map = TDenseHashMapStaticMarker<int, TString, -1>; + Map mp(3, NFlatHash::NMap::TStaticValueMarker<-1, TString>(), typename Map::allocator_type()); +} + using TFlatHashMapTest = TMapTest<TFlatHashMap<int, TString>>; using TDenseHashMapTest = TMapTest<TDenseHashMapStaticMarker<int, TString, -1>>; @@ -156,7 +156,7 @@ UNIT_TEST_SUITE_REGISTRATION(TDenseHashMapTest); template <class Set> class TSetTest : public TTestBase { - void AllocatorTest(); + void AllocatorTest(); void DefaultConstructTest() { Set st; @@ -241,7 +241,7 @@ class TSetTest : public TTestBase { } UNIT_TEST_SUITE_DEMANGLE(TSetTest); - UNIT_TEST(AllocatorTest); + UNIT_TEST(AllocatorTest); UNIT_TEST(DefaultConstructTest); UNIT_TEST(InitCapacityConstructTest); UNIT_TEST(IteratorsConstructTest); @@ -253,19 +253,19 @@ class TSetTest : public TTestBase { UNIT_TEST_SUITE_END(); }; -template <> -void TSetTest<TFlatHashSet<int>>::AllocatorTest() { - using Map = TFlatHashSet<int>; - Map mp(3, typename Map::allocator_type()); -} - -template <> -void TSetTest<TDenseHashSetStaticMarker<int, -1>>::AllocatorTest() { - using Map = TDenseHashSetStaticMarker<int, -1>; - Map mp(3, NFlatHash::NSet::TStaticValueMarker<-1>(), typename Map::allocator_type()); -} - -using TFlatHashSetTest = TSetTest<TFlatHashSet<int, THash<int>>>; +template <> +void TSetTest<TFlatHashSet<int>>::AllocatorTest() { + using Map = TFlatHashSet<int>; + Map mp(3, typename Map::allocator_type()); +} + +template <> +void TSetTest<TDenseHashSetStaticMarker<int, -1>>::AllocatorTest() { + using Map = TDenseHashSetStaticMarker<int, -1>; + Map mp(3, NFlatHash::NSet::TStaticValueMarker<-1>(), typename Map::allocator_type()); +} + +using TFlatHashSetTest = TSetTest<TFlatHashSet<int, THash<int>>>; using TDenseHashSetTest = TSetTest<TDenseHashSetStaticMarker<int, -1>>; UNIT_TEST_SUITE_REGISTRATION(TFlatHashSetTest); diff --git a/library/cpp/getopt/small/last_getopt_opts.h b/library/cpp/getopt/small/last_getopt_opts.h index 1361ad6731..825b99c871 100644 --- a/library/cpp/getopt/small/last_getopt_opts.h +++ b/library/cpp/getopt/small/last_getopt_opts.h @@ -43,7 +43,7 @@ namespace NLastGetopt { typedef TVector<TSimpleSharedPtr<TOpt>> TOptsVector; TOptsVector Opts_; // infomation about named (short and long) options - TVector<std::function<void(TStringBuf)>> ArgBindings_; + TVector<std::function<void(TStringBuf)>> ArgBindings_; EArgPermutation ArgPermutation_ = DEFAULT_ARG_PERMUTATION; // determines how to parse positions of named and free options. See information below. bool AllowSingleDashForLong_ = false; // @@ -245,22 +245,22 @@ namespace NLastGetopt { TOpt& AddOption(const TOpt& option); /** - * Creates new free argument handling - * @param name name of free arg to show in help - * @param target variable address to store parsing result into - * @param help help string to show in help - */ - template <typename T> - void AddFreeArgBinding(const TString& name, T& target, const TString& help = "") { - ArgBindings_.emplace_back([&target](TStringBuf value) { - target = FromString<T>(value); - }); - - FreeArgsMax_ = Max<ui32>(FreeArgsMax_, ArgBindings_.size()); - SetFreeArgTitle(ArgBindings_.size() - 1, name, help); - } - - /** + * Creates new free argument handling + * @param name name of free arg to show in help + * @param target variable address to store parsing result into + * @param help help string to show in help + */ + template <typename T> + void AddFreeArgBinding(const TString& name, T& target, const TString& help = "") { + ArgBindings_.emplace_back([&target](TStringBuf value) { + target = FromString<T>(value); + }); + + FreeArgsMax_ = Max<ui32>(FreeArgsMax_, ArgBindings_.size()); + SetFreeArgTitle(ArgBindings_.size() - 1, name, help); + } + + /** * Creates options list from string as in getopt(3) * * @param optstring source @@ -460,11 +460,11 @@ namespace NLastGetopt { /** * Set maximal number of free args * - * @param max new value + * @param max new value */ void SetFreeArgsMax(size_t max) { FreeArgsMax_ = ui32(max); - FreeArgsMax_ = Max<ui32>(FreeArgsMax_, ArgBindings_.size()); + FreeArgsMax_ = Max<ui32>(FreeArgsMax_, ArgBindings_.size()); } /** diff --git a/library/cpp/getopt/small/last_getopt_parse_result.cpp b/library/cpp/getopt/small/last_getopt_parse_result.cpp index d7230c2592..f4b5607a90 100644 --- a/library/cpp/getopt/small/last_getopt_parse_result.cpp +++ b/library/cpp/getopt/small/last_getopt_parse_result.cpp @@ -126,16 +126,16 @@ namespace NLastGetopt { TOptParseResult& r = OptParseResult(); r.AddValue(Parser_->CurValOrOpt().data()); } - - Y_ENSURE(options); - const auto freeArgs = GetFreeArgs(); - for (size_t i = 0; i < freeArgs.size(); ++i) { - if (i >= options->ArgBindings_.size()) { - break; - } - - options->ArgBindings_[i](freeArgs[i]); - } + + Y_ENSURE(options); + const auto freeArgs = GetFreeArgs(); + for (size_t i = 0; i < freeArgs.size(); ++i) { + if (i >= options->ArgBindings_.size()) { + break; + } + + options->ArgBindings_[i](freeArgs[i]); + } } catch (...) { HandleError(); } diff --git a/library/cpp/getopt/ut/last_getopt_ut.cpp b/library/cpp/getopt/ut/last_getopt_ut.cpp index 9b6dcbbc27..c99a1d053d 100644 --- a/library/cpp/getopt/ut/last_getopt_ut.cpp +++ b/library/cpp/getopt/ut/last_getopt_ut.cpp @@ -779,16 +779,16 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { TOptsParseResultException(&opts, Y_ARRAY_SIZE(argv), argv), TUsageException); } - - Y_UNIT_TEST(TestFreeArgsStoreResult) { - TOptsNoDefault opts; - TString data; - int number = 0; - opts.AddFreeArgBinding("data", data); - opts.AddFreeArgBinding("number", number); - TOptsParseResultTestWrapper r(&opts, V({"cmd", "hello", "25"})); - UNIT_ASSERT_VALUES_EQUAL("hello", data); - UNIT_ASSERT_VALUES_EQUAL(25, number); - UNIT_ASSERT_VALUES_EQUAL(2, r.GetFreeArgCount()); - } + + Y_UNIT_TEST(TestFreeArgsStoreResult) { + TOptsNoDefault opts; + TString data; + int number = 0; + opts.AddFreeArgBinding("data", data); + opts.AddFreeArgBinding("number", number); + TOptsParseResultTestWrapper r(&opts, V({"cmd", "hello", "25"})); + UNIT_ASSERT_VALUES_EQUAL("hello", data); + UNIT_ASSERT_VALUES_EQUAL(25, number); + UNIT_ASSERT_VALUES_EQUAL(2, r.GetFreeArgCount()); + } } diff --git a/library/cpp/http/io/headers.cpp b/library/cpp/http/io/headers.cpp index 2f6992100c..4ec27a29e8 100644 --- a/library/cpp/http/io/headers.cpp +++ b/library/cpp/http/io/headers.cpp @@ -60,16 +60,16 @@ THttpHeaders::THttpHeaders(IInputStream* stream) { } bool THttpHeaders::HasHeader(const TStringBuf header) const { - return FindHeader(header); -} - + return FindHeader(header); +} + const THttpInputHeader* THttpHeaders::FindHeader(const TStringBuf header) const { - for (const auto& hdr : Headers_) { + for (const auto& hdr : Headers_) { if (AsciiCompareIgnoreCase(hdr.Name(), header) == 0) { - return &hdr; + return &hdr; } } - return nullptr; + return nullptr; } void THttpHeaders::RemoveHeader(const TStringBuf header) { diff --git a/library/cpp/http/io/headers.h b/library/cpp/http/io/headers.h index 16e979236c..a71793d1c6 100644 --- a/library/cpp/http/io/headers.h +++ b/library/cpp/http/io/headers.h @@ -2,9 +2,9 @@ #include <util/generic/string.h> #include <util/generic/strbuf.h> -#include <util/generic/deque.h> +#include <util/generic/deque.h> #include <util/generic/vector.h> -#include <util/string/cast.h> +#include <util/string/cast.h> class IInputStream; class IOutputStream; @@ -105,10 +105,10 @@ public: /// Удаляет заголовок, если он есть. void RemoveHeader(TStringBuf header); - /// Ищет заголовок по указанному имени - /// Возвращает nullptr, если не нашел + /// Ищет заголовок по указанному имени + /// Возвращает nullptr, если не нашел const THttpInputHeader* FindHeader(TStringBuf header) const; - + /// Записывает все заголовки контейнера в поток. /// @details Каждый заголовк записывается в виде "имя параметра: значение\r\n". void OutTo(IOutputStream* stream) const; diff --git a/library/cpp/http/io/headers_ut.cpp b/library/cpp/http/io/headers_ut.cpp index dd963d7fd1..1d23ef8fdc 100644 --- a/library/cpp/http/io/headers_ut.cpp +++ b/library/cpp/http/io/headers_ut.cpp @@ -49,7 +49,7 @@ class THttpHeadersTest: public TTestBase { UNIT_TEST(TestAddOrReplaceOperation1Arg); UNIT_TEST(TestAddOrReplaceOperation2Args); UNIT_TEST(TestAddHeaderTemplateness); - UNIT_TEST(TestFindHeader); + UNIT_TEST(TestFindHeader); UNIT_TEST_SUITE_END(); private: @@ -62,7 +62,7 @@ public: void TestAddOrReplaceOperation1Arg(); void TestAddOrReplaceOperation2Args(); void TestAddHeaderTemplateness(); - void TestFindHeader(); + void TestFindHeader(); private: static void AddHeaderImpl1Arg(THttpHeaders& headers, TStringBuf name, TStringBuf value) { @@ -166,11 +166,11 @@ void THttpHeadersTest::TestAddHeaderTemplateness() { UNIT_ASSERT(h1 == h2); } - -void THttpHeadersTest::TestFindHeader() { - THttpHeaders sut; - sut.AddHeader("NaMe", "Value"); - - UNIT_ASSERT(sut.FindHeader("name")); - UNIT_ASSERT(sut.FindHeader("name")->Value() == "Value"); -} + +void THttpHeadersTest::TestFindHeader() { + THttpHeaders sut; + sut.AddHeader("NaMe", "Value"); + + UNIT_ASSERT(sut.FindHeader("name")); + UNIT_ASSERT(sut.FindHeader("name")->Value() == "Value"); +} diff --git a/library/cpp/http/server/http.cpp b/library/cpp/http/server/http.cpp index ef5bd5d6a3..128583bdd7 100644 --- a/library/cpp/http/server/http.cpp +++ b/library/cpp/http/server/http.cpp @@ -816,10 +816,10 @@ bool TryToBindAddresses(const THttpServerOptions& options, const std::function<v FixIPv6ListenSocket(socket); - if (options.ReuseAddress) { - int yes = 1; - ::setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, (const char*)&yes, sizeof(yes)); - } + if (options.ReuseAddress) { + int yes = 1; + ::setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, (const char*)&yes, sizeof(yes)); + } if (options.ReusePort) { SetReusePort(socket, true); diff --git a/library/cpp/http/server/options.h b/library/cpp/http/server/options.h index dfc2258493..38eda0e5e7 100644 --- a/library/cpp/http/server/options.h +++ b/library/cpp/http/server/options.h @@ -56,12 +56,12 @@ public: return *this; } - inline THttpServerOptions& EnableReuseAddress(bool enable) noexcept { - ReuseAddress = enable; - - return *this; - } - + inline THttpServerOptions& EnableReuseAddress(bool enable) noexcept { + ReuseAddress = enable; + + return *this; + } + inline THttpServerOptions& SetThreads(ui32 threads) noexcept { nThreads = threads; @@ -150,7 +150,7 @@ public: bool CompressionEnabled = false; bool RejectExcessConnections = false; bool ReusePort = false; // set SO_REUSEPORT socket option - bool ReuseAddress = true; // set SO_REUSEADDR socket option + bool ReuseAddress = true; // set SO_REUSEADDR socket option TAddrs BindSockaddr; ui16 Port = 17000; // The port on which to run the web server TString Host; // DNS entry diff --git a/library/cpp/string_utils/base64/base64_decode_uneven_ut.cpp b/library/cpp/string_utils/base64/base64_decode_uneven_ut.cpp index 07594a6ded..c3ed068a37 100644 --- a/library/cpp/string_utils/base64/base64_decode_uneven_ut.cpp +++ b/library/cpp/string_utils/base64/base64_decode_uneven_ut.cpp @@ -1,7 +1,7 @@ #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/string_utils/base64/base64.h> - + Y_UNIT_TEST_SUITE(TBase64DecodeUneven) { Y_UNIT_TEST(Base64DecodeUneven) { const TString wikipedia_slogan = |