diff options
author | spacelord <spacelord@yandex-team.ru> | 2022-02-10 16:48:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:15 +0300 |
commit | a0c6d9ad0cf6b94c527a15da147eb24335281b6d (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /library/cpp | |
parent | 16747e4f77455cca4932df21eb76f12cb0a97a5c (diff) | |
download | ydb-a0c6d9ad0cf6b94c527a15da147eb24335281b6d.tar.gz |
Restoring authorship annotation for <spacelord@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp')
-rw-r--r-- | library/cpp/bit_io/bitinout_ut.cpp | 2 | ||||
-rw-r--r-- | library/cpp/charset/recyr_int.hh | 6 | ||||
-rw-r--r-- | library/cpp/charset/wide.h | 14 | ||||
-rw-r--r-- | library/cpp/containers/atomizer/atomizer.h | 28 | ||||
-rw-r--r-- | library/cpp/containers/intrusive_avl_tree/avltree.h | 6 | ||||
-rw-r--r-- | library/cpp/containers/intrusive_avl_tree/ut/avltree_ut.cpp | 2 | ||||
-rw-r--r-- | library/cpp/containers/intrusive_rb_tree/rb_tree.h | 38 | ||||
-rw-r--r-- | library/cpp/containers/intrusive_rb_tree/rb_tree_ut.cpp | 2 | ||||
-rw-r--r-- | library/cpp/containers/str_map/str_map.h | 36 | ||||
-rw-r--r-- | library/cpp/deprecated/accessors/accessors_impl.h | 12 | ||||
-rw-r--r-- | library/cpp/deprecated/accessors/memory_traits.h | 14 | ||||
-rw-r--r-- | library/cpp/deprecated/split/split_iterator.h | 18 | ||||
-rw-r--r-- | library/cpp/digest/lower_case/lchash.h | 2 | ||||
-rw-r--r-- | library/cpp/retry/retry.cpp | 12 | ||||
-rw-r--r-- | library/cpp/retry/retry.h | 46 |
15 files changed, 119 insertions, 119 deletions
diff --git a/library/cpp/bit_io/bitinout_ut.cpp b/library/cpp/bit_io/bitinout_ut.cpp index 3f3e4afcfd..23a1ddf344 100644 --- a/library/cpp/bit_io/bitinout_ut.cpp +++ b/library/cpp/bit_io/bitinout_ut.cpp @@ -51,7 +51,7 @@ class TBitIOTest: public TTestBase { UNIT_TEST_SUITE_END(); private: - using TBi = NBitIO::TBitInput; + using TBi = NBitIO::TBitInput; using TVec = TVector<char>; void static CheckBits(const TVec& v, const TString& ref, const TString& rem) { diff --git a/library/cpp/charset/recyr_int.hh b/library/cpp/charset/recyr_int.hh index 8354687c25..353af53305 100644 --- a/library/cpp/charset/recyr_int.hh +++ b/library/cpp/charset/recyr_int.hh @@ -178,19 +178,19 @@ namespace NCodepagePrivate { template <class TCharType> struct TCharTypeSwitch<TCharType, 2> { - using TRealCharType = wchar16; + using TRealCharType = wchar16; }; template <class TCharType> struct TCharTypeSwitch<TCharType, 4> { - using TRealCharType = wchar32; + using TRealCharType = wchar32; }; template <class TCharType> inline RECODE_RESULT _recodeUnicodeToUTF8(const TCharType* in, char* out, size_t in_size, size_t out_size, size_t& in_readed, size_t& out_writed) { static_assert(sizeof(TCharType) > 1, "expect some wide type"); - using TRealCharType = typename TCharTypeSwitch<TCharType>::TRealCharType; + using TRealCharType = typename TCharTypeSwitch<TCharType>::TRealCharType; return _recodeUnicodeToUTF8Impl(reinterpret_cast<const TRealCharType*>(in), out, in_size, out_size, in_readed, out_writed); } diff --git a/library/cpp/charset/wide.h b/library/cpp/charset/wide.h index db4a178e7e..32d30e849e 100644 --- a/library/cpp/charset/wide.h +++ b/library/cpp/charset/wide.h @@ -121,8 +121,8 @@ namespace NDetail { template <> struct TRecodeTraits<char> { - using TCharTo = wchar16; - using TStringBufTo = TWtringBuf; + using TCharTo = wchar16; + using TStringBufTo = TWtringBuf; using TStringTo = TUtf16String; enum { ReserveSize = 4 }; // How many TCharFrom characters we should reserve for one TCharTo character in worst case // Here an unicode character can be converted up to 4 bytes of UTF8 @@ -130,8 +130,8 @@ namespace NDetail { template <> struct TRecodeTraits<wchar16> { - using TCharTo = char; - using TStringBufTo = TStringBuf; + using TCharTo = char; + using TStringBufTo = TStringBuf; using TStringTo = TString; enum { ReserveSize = 2 }; // possible surrogate pairs ? }; @@ -140,7 +140,7 @@ namespace NDetail { template <typename TResult> struct TRecodeResultOps { // default implementation will work with TString and TUtf16String - 99% of usage - using TResultChar = typename TResult::char_type; + using TResultChar = typename TResult::char_type; static inline size_t Size(const TResult& dst) { return dst.size(); @@ -160,7 +160,7 @@ namespace NDetail { template <typename TCharFrom, typename TResult> typename TRecodeTraits<TCharFrom>::TStringBufTo Recode(const TBasicStringBuf<TCharFrom> src, TResult& dst, ECharset encoding) { - using TCharTo = typename TRecodeTraits<TCharFrom>::TCharTo; + using TCharTo = typename TRecodeTraits<TCharFrom>::TCharTo; // make enough room for re-coded string TCharTo* dstbuf = TRecodeResultOps<TResult>::Reserve(dst, src.size() * TRecodeTraits<TCharTo>::ReserveSize); // do re-coding @@ -173,7 +173,7 @@ namespace NDetail { // appending version of Recode() template <typename TCharFrom, typename TResult> typename TRecodeTraits<TCharFrom>::TStringBufTo RecodeAppend(const TBasicStringBuf<TCharFrom> src, TResult& dst, ECharset encoding) { - using TCharTo = typename TRecodeTraits<TCharFrom>::TCharTo; + using TCharTo = typename TRecodeTraits<TCharFrom>::TCharTo; size_t dstOrigSize = TRecodeResultOps<TResult>::Size(dst); TCharTo* dstbuf = TRecodeResultOps<TResult>::Reserve(dst, dstOrigSize + src.size() * TRecodeTraits<TCharTo>::ReserveSize); TBasicStringBuf<TCharTo> appended = NBaseOps::Recode(src, dstbuf + dstOrigSize, encoding); diff --git a/library/cpp/containers/atomizer/atomizer.h b/library/cpp/containers/atomizer/atomizer.h index 164b018e2d..5e40f47ab9 100644 --- a/library/cpp/containers/atomizer/atomizer.h +++ b/library/cpp/containers/atomizer/atomizer.h @@ -20,11 +20,11 @@ private: TVector<const char*> order; public: - using iterator = typename string_hash<ui32, HashFcn, EqualTo>::iterator; - using const_iterator = typename string_hash<ui32, HashFcn, EqualTo>::const_iterator; - using value_type = typename string_hash<ui32, HashFcn, EqualTo>::value_type; - using size_type = typename string_hash<ui32, HashFcn, EqualTo>::size_type; - using pool_size_type = typename string_hash<ui32, HashFcn, EqualTo>::pool_size_type; + using iterator = typename string_hash<ui32, HashFcn, EqualTo>::iterator; + using const_iterator = typename string_hash<ui32, HashFcn, EqualTo>::const_iterator; + using value_type = typename string_hash<ui32, HashFcn, EqualTo>::value_type; + using size_type = typename string_hash<ui32, HashFcn, EqualTo>::size_type; + using pool_size_type = typename string_hash<ui32, HashFcn, EqualTo>::pool_size_type; using string_hash<ui32, HashFcn, EqualTo>::pool; using string_hash<ui32, HashFcn, EqualTo>::size; @@ -112,15 +112,15 @@ private: TOrder order; public: - using iterator = typename string_hash<ui32, HashFcn, EqualTo>::iterator; - using const_iterator = typename string_hash<ui32, HashFcn, EqualTo>::const_iterator; - using value_type = typename string_hash<ui32, HashFcn, EqualTo>::value_type; - using size_type = typename string_hash<ui32, HashFcn, EqualTo>::size_type; - using pool_size_type = typename string_hash<ui32, HashFcn, EqualTo>::pool_size_type; - - using o_iterator = typename TOrder::iterator; - using o_const_iterator = typename TOrder::const_iterator; - using o_value_type = typename TOrder::value_type; + using iterator = typename string_hash<ui32, HashFcn, EqualTo>::iterator; + using const_iterator = typename string_hash<ui32, HashFcn, EqualTo>::const_iterator; + using value_type = typename string_hash<ui32, HashFcn, EqualTo>::value_type; + using size_type = typename string_hash<ui32, HashFcn, EqualTo>::size_type; + using pool_size_type = typename string_hash<ui32, HashFcn, EqualTo>::pool_size_type; + + using o_iterator = typename TOrder::iterator; + using o_const_iterator = typename TOrder::const_iterator; + using o_value_type = typename TOrder::value_type; using string_hash<ui32, HashFcn, EqualTo>::pool; using string_hash<ui32, HashFcn, EqualTo>::size; diff --git a/library/cpp/containers/intrusive_avl_tree/avltree.h b/library/cpp/containers/intrusive_avl_tree/avltree.h index a1af47c53a..a58c63b07c 100644 --- a/library/cpp/containers/intrusive_avl_tree/avltree.h +++ b/library/cpp/containers/intrusive_avl_tree/avltree.h @@ -7,7 +7,7 @@ struct TAvlTreeItem; template <class T, class C> class TAvlTree: public TNonCopyable { - using TTreeItem = TAvlTreeItem<T, C>; + using TTreeItem = TAvlTreeItem<T, C>; friend struct TAvlTreeItem<T, C>; static inline const T* AsT(const TTreeItem* item) noexcept { @@ -178,7 +178,7 @@ class TAvlTree: public TNonCopyable { public: using const_iterator = TConstIterator; - using iterator = TIterator; + using iterator = TIterator; inline TAvlTree() noexcept : Root_(nullptr) @@ -721,7 +721,7 @@ private: template <class T, class C> struct TAvlTreeItem: public TNonCopyable { public: - using TTree = TAvlTree<T, C>; + using TTree = TAvlTree<T, C>; friend class TAvlTree<T, C>; friend typename TAvlTree<T, C>::TConstIterator; friend typename TAvlTree<T, C>::TIterator; diff --git a/library/cpp/containers/intrusive_avl_tree/ut/avltree_ut.cpp b/library/cpp/containers/intrusive_avl_tree/ut/avltree_ut.cpp index 87807f0492..cab2365cce 100644 --- a/library/cpp/containers/intrusive_avl_tree/ut/avltree_ut.cpp +++ b/library/cpp/containers/intrusive_avl_tree/ut/avltree_ut.cpp @@ -27,7 +27,7 @@ private: int Val; }; - using TIts = TAvlTree<TIt, TItCompare>; + using TIts = TAvlTree<TIt, TItCompare>; }; inline bool TAvlTreeTest::TItCompare::Compare(const TIt& l, const TIt& r) noexcept { diff --git a/library/cpp/containers/intrusive_rb_tree/rb_tree.h b/library/cpp/containers/intrusive_rb_tree/rb_tree.h index 5539d6391b..0259452a14 100644 --- a/library/cpp/containers/intrusive_rb_tree/rb_tree.h +++ b/library/cpp/containers/intrusive_rb_tree/rb_tree.h @@ -3,14 +3,14 @@ #include <util/generic/utility.h> #include <util/generic/yexception.h> -using TRbTreeColorType = bool; +using TRbTreeColorType = bool; #define RBTreeRed false #define RBTreeBlack true struct TRbTreeNodeBase { - using TColorType = TRbTreeColorType; - using TBasePtr = TRbTreeNodeBase*; + using TColorType = TRbTreeColorType; + using TBasePtr = TRbTreeNodeBase*; TColorType Color_; TBasePtr Parent_; @@ -63,7 +63,7 @@ struct TRbTreeBaseIterator; template <class TDummy> class TRbGlobal { public: - using TBasePtr = TRbTreeNodeBase*; + using TBasePtr = TRbTreeNodeBase*; static void Rebalance(TBasePtr x, TBasePtr& root); static TBasePtr RebalanceForErase(TBasePtr z, TBasePtr& root, TBasePtr& leftmost, TBasePtr& rightmost); @@ -76,10 +76,10 @@ public: static void RotateRight(TBasePtr x, TBasePtr& root); }; -using TRbGlobalInst = TRbGlobal<bool>; +using TRbGlobalInst = TRbGlobal<bool>; struct TRbTreeBaseIterator { - using TBasePtr = TRbTreeNodeBase*; + using TBasePtr = TRbTreeNodeBase*; TBasePtr Node_; inline TRbTreeBaseIterator(TBasePtr x = nullptr) noexcept @@ -90,10 +90,10 @@ struct TRbTreeBaseIterator { template <class TValue, class TTraits> struct TRbTreeIterator: public TRbTreeBaseIterator { - using TReference = typename TTraits::TReference; - using TPointer = typename TTraits::TPointer; - using TSelf = TRbTreeIterator<TValue, TTraits>; - using TBasePtr = TRbTreeNodeBase*; + using TReference = typename TTraits::TReference; + using TPointer = typename TTraits::TPointer; + using TSelf = TRbTreeIterator<TValue, TTraits>; + using TBasePtr = TRbTreeNodeBase*; inline TRbTreeIterator() noexcept = default; @@ -161,18 +161,18 @@ class TRbTree { }; struct TNonConstTraits { - using TReference = TValue&; - using TPointer = TValue*; + using TReference = TValue&; + using TPointer = TValue*; }; struct TConstTraits { - using TReference = const TValue&; - using TPointer = const TValue*; + using TReference = const TValue&; + using TPointer = const TValue*; }; - using TNodeBase = TRbTreeNodeBase; - using TBasePtr = TRbTreeNodeBase*; - using TColorType = TRbTreeColorType; + using TNodeBase = TRbTreeNodeBase; + using TBasePtr = TRbTreeNodeBase*; + using TColorType = TRbTreeColorType; public: class TRealNode: public TNodeBase { @@ -206,8 +206,8 @@ public: TRbTree* Tree_; }; - using TIterator = TRbTreeIterator<TValue, TNonConstTraits>; - using TConstIterator = TRbTreeIterator<TValue, TConstTraits>; + using TIterator = TRbTreeIterator<TValue, TNonConstTraits>; + using TConstIterator = TRbTreeIterator<TValue, TConstTraits>; inline TRbTree() noexcept { Init(); diff --git a/library/cpp/containers/intrusive_rb_tree/rb_tree_ut.cpp b/library/cpp/containers/intrusive_rb_tree/rb_tree_ut.cpp index 8eb7cad122..c34ed1fd9b 100644 --- a/library/cpp/containers/intrusive_rb_tree/rb_tree_ut.cpp +++ b/library/cpp/containers/intrusive_rb_tree/rb_tree_ut.cpp @@ -34,7 +34,7 @@ class TRedBlackTreeTest: public TTestBase { int N; }; - using TTree = TRbTree<TNode, TCmp>; + using TTree = TRbTree<TNode, TCmp>; UNIT_TEST_SUITE(TRedBlackTreeTest); UNIT_TEST(TestEmpty) diff --git a/library/cpp/containers/str_map/str_map.h b/library/cpp/containers/str_map/str_map.h index b3479867dd..31b00d1b99 100644 --- a/library/cpp/containers/str_map/str_map.h +++ b/library/cpp/containers/str_map/str_map.h @@ -41,11 +41,11 @@ protected: public: using yh = THashMap<const char*, T, HashFcn, EqualTo, Alloc>; - using iterator = typename yh::iterator; - using const_iterator = typename yh::const_iterator; - using mapped_type = typename yh::mapped_type; - using size_type = typename yh::size_type; - using pool_size_type = typename yh::size_type; + using iterator = typename yh::iterator; + using const_iterator = typename yh::const_iterator; + using mapped_type = typename yh::mapped_type; + using size_type = typename yh::size_type; + using pool_size_type = typename yh::size_type; string_hash() { pool.Reserve(HASH_SIZE_DEFAULT * AVERAGEWORD_BUF); // reserve here } @@ -107,12 +107,12 @@ protected: public: using yh = THashMap<const C*, T, HashFcn, EqualTo>; - using iterator = typename yh::iterator; - using const_iterator = typename yh::const_iterator; - using mapped_type = typename yh::mapped_type; - using size_type = typename yh::size_type; - using key_type = typename yh::key_type; - using value_type = typename yh::value_type; + using iterator = typename yh::iterator; + using const_iterator = typename yh::const_iterator; + using mapped_type = typename yh::mapped_type; + using size_type = typename yh::size_type; + using key_type = typename yh::key_type; + using value_type = typename yh::value_type; THashWithSegmentedPoolForKeys(size_type hash_size = HASH_SIZE_DEFAULT, size_t segsize = HASH_SIZE_DEFAULT * AVERAGEWORD_BUF, bool afs = false) : yh(hash_size) @@ -178,13 +178,13 @@ public: template <class T, class HashFcn, class EqualTo> class segmented_string_hash: public THashWithSegmentedPoolForKeys<char, T, HashFcn, EqualTo> { public: - using Base = THashWithSegmentedPoolForKeys<char, T, HashFcn, EqualTo>; - using iterator = typename Base::iterator; - using const_iterator = typename Base::const_iterator; - using mapped_type = typename Base::mapped_type; - using size_type = typename Base::size_type; - using key_type = typename Base::key_type; - using value_type = typename Base::value_type; + using Base = THashWithSegmentedPoolForKeys<char, T, HashFcn, EqualTo>; + using iterator = typename Base::iterator; + using const_iterator = typename Base::const_iterator; + using mapped_type = typename Base::mapped_type; + using size_type = typename Base::size_type; + using key_type = typename Base::key_type; + using value_type = typename Base::value_type; public: segmented_string_hash(size_type hash_size = HASH_SIZE_DEFAULT, size_t segsize = HASH_SIZE_DEFAULT * AVERAGEWORD_BUF, bool afs = false) diff --git a/library/cpp/deprecated/accessors/accessors_impl.h b/library/cpp/deprecated/accessors/accessors_impl.h index 63b0fc6783..6b2b987351 100644 --- a/library/cpp/deprecated/accessors/accessors_impl.h +++ b/library/cpp/deprecated/accessors/accessors_impl.h @@ -16,7 +16,7 @@ namespace NAccessors { template <typename Ta> struct TBegin: public TMemoryAccessorBase<Ta> { - using TElementType = typename TMemoryTraits<Ta>::TElementType; + using TElementType = typename TMemoryTraits<Ta>::TElementType; template <typename Tb> struct TNoMemoryIndirectionBegin { @@ -57,7 +57,7 @@ namespace NAccessors { std::conditional_t< TMemoryAccessorBase<Ta>::ContinuousMemory, TIndirectMemoryRegionBegin<Ta>, - typename TMemoryAccessorBase<Ta>::TBadAccessor>>; + typename TMemoryAccessorBase<Ta>::TBadAccessor>>; static const TElementType* Get(const Ta& b) { return TGet::Get(b); @@ -66,7 +66,7 @@ namespace NAccessors { template <typename Ta> struct TEnd: public TMemoryAccessorBase<Ta> { - using TElementType = typename TMemoryTraits<Ta>::TElementType; + using TElementType = typename TMemoryTraits<Ta>::TElementType; template <typename Tb> struct TNoMemoryIndirectionEnd { @@ -107,7 +107,7 @@ namespace NAccessors { std::conditional_t< TMemoryAccessorBase<Ta>::ContinuousMemory, TIndirectMemoryRegionEnd<Ta>, - typename TMemoryAccessorBase<Ta>::TBadAccessor>>; + typename TMemoryAccessorBase<Ta>::TBadAccessor>>; static const TElementType* Get(const Ta& b) { return TGet::Get(b); @@ -345,7 +345,7 @@ namespace NAccessors { template <typename Ta> struct TAssign: public TMemoryAccessorBase<Ta> { - using TElementType = typename TMemoryTraits<Ta>::TElementType; + using TElementType = typename TMemoryTraits<Ta>::TElementType; template <typename Tb> struct TNoMemoryIndirectionAssign { @@ -403,7 +403,7 @@ namespace NAccessors { std::conditional_t< TMemoryTraits<Tb>::OwnsMemory, TByClearAppend<Tb>, - TByConstruction<Tb>>>>; + TByConstruction<Tb>>>>; static void Do(Tb& b, const TElementType* beg, const TElementType* end) { TDo::Do(b, beg, end); diff --git a/library/cpp/deprecated/accessors/memory_traits.h b/library/cpp/deprecated/accessors/memory_traits.h index 3905728676..aa837705d3 100644 --- a/library/cpp/deprecated/accessors/memory_traits.h +++ b/library/cpp/deprecated/accessors/memory_traits.h @@ -21,7 +21,7 @@ struct TMemoryTraits { OwnsMemory = SimpleMemory, }; - using TElementType = T; + using TElementType = T; }; template <typename T, size_t n> @@ -32,7 +32,7 @@ struct TMemoryTraits<T[n]> { OwnsMemory = SimpleMemory, }; - using TElementType = T; + using TElementType = T; }; template <typename T, size_t n> @@ -43,7 +43,7 @@ struct TMemoryTraits<std::array<T, n>> { OwnsMemory = SimpleMemory, }; - using TElementType = T; + using TElementType = T; }; template <typename A, typename B> @@ -65,7 +65,7 @@ struct TMemoryTraits<TBuffer> { OwnsMemory = true, }; - using TElementType = char; + using TElementType = char; }; template <> @@ -76,7 +76,7 @@ struct TMemoryTraits<TTempBuf> { OwnsMemory = true, }; - using TElementType = char; + using TElementType = char; }; template <> @@ -87,7 +87,7 @@ struct TMemoryTraits< ::TBlob> { OwnsMemory = true, }; - using TElementType = char; + using TElementType = char; }; template <typename T> @@ -97,7 +97,7 @@ struct TElementDependentMemoryTraits { ContinuousMemory = TMemoryTraits<T>::SimpleMemory, }; - using TElementType = T; + using TElementType = T; }; template <typename T, typename TAlloc> diff --git a/library/cpp/deprecated/split/split_iterator.h b/library/cpp/deprecated/split/split_iterator.h index dfa0b3420f..0eacc29228 100644 --- a/library/cpp/deprecated/split/split_iterator.h +++ b/library/cpp/deprecated/split/split_iterator.h @@ -41,8 +41,8 @@ struct TNumPair { } }; -using TSizeTRegion = TNumPair<size_t>; -using TUi32Region = TNumPair<ui32>; +using TSizeTRegion = TNumPair<size_t>; +using TUi32Region = TNumPair<ui32>; template <> inline TString ToString(const TUi32Region& r) { @@ -103,7 +103,7 @@ private: const TSplitDelimiters& Delimiters; public: - using TIterator = TSplitIterator<TDelimitersSplit>; + using TIterator = TSplitIterator<TDelimitersSplit>; friend class TSplitIterator<TDelimitersSplit>; TDelimitersSplit(const char* str, size_t length, const TSplitDelimiters& delimiters); @@ -124,7 +124,7 @@ private: const TSplitDelimiters& Delimiters; public: - using TIterator = TSplitIterator<TDelimitersStrictSplit>; + using TIterator = TSplitIterator<TDelimitersStrictSplit>; friend class TSplitIterator<TDelimitersStrictSplit>; TDelimitersStrictSplit(const char* str, size_t length, const TSplitDelimiters& delimiters); @@ -146,7 +146,7 @@ private: const TSplitDelimiters& Screens; public: - using TIterator = TSplitIterator<TScreenedDelimitersSplit>; + using TIterator = TSplitIterator<TScreenedDelimitersSplit>; friend class TSplitIterator<TScreenedDelimitersSplit>; TScreenedDelimitersSplit(const char*, size_t, const TSplitDelimiters& delimiters, const TSplitDelimiters& screens); @@ -169,7 +169,7 @@ private: size_t SkipDelimiters(size_t pos) const; public: - using TIterator = TSplitIterator<TDelimitersSplitWithoutTags>; + using TIterator = TSplitIterator<TDelimitersSplitWithoutTags>; friend class TSplitIterator<TDelimitersSplitWithoutTags>; TDelimitersSplitWithoutTags(const char* str, size_t length, const TSplitDelimiters& delimiters); @@ -187,7 +187,7 @@ private: class TCharSplit: public TSplitBase { public: - using TIterator = TSplitIterator<TCharSplit>; + using TIterator = TSplitIterator<TCharSplit>; friend class TSplitIterator<TCharSplit>; TCharSplit(const char* str, size_t length); @@ -211,7 +211,7 @@ private: size_t SkipDelimiters(size_t pos) const; public: - using TIterator = TSplitIterator<TCharSplitWithoutTags>; + using TIterator = TSplitIterator<TCharSplitWithoutTags>; friend class TSplitIterator<TCharSplitWithoutTags>; TCharSplitWithoutTags(const char* str, size_t length); @@ -238,7 +238,7 @@ private: const TSubstringSplitDelimiter& Delimiter; public: - using TIterator = TSplitIterator<TSubstringSplit>; + using TIterator = TSplitIterator<TSubstringSplit>; friend class TSplitIterator<TSubstringSplit>; TSubstringSplit(const char* str, size_t length, const TSubstringSplitDelimiter& delimiter); diff --git a/library/cpp/digest/lower_case/lchash.h b/library/cpp/digest/lower_case/lchash.h index 6cb109c2e9..6a287d9479 100644 --- a/library/cpp/digest/lower_case/lchash.h +++ b/library/cpp/digest/lower_case/lchash.h @@ -7,7 +7,7 @@ template <class T> static inline T FnvCaseLess(const char* b, size_t l, T t = 0) noexcept { - using TIter = TLowerCaseIterator<const char>; + using TIter = TLowerCaseIterator<const char>; return FnvHash(TIter(b), TIter(b + l), t); } diff --git a/library/cpp/retry/retry.cpp b/library/cpp/retry/retry.cpp index efb2ec3dbc..92466cdeca 100644 --- a/library/cpp/retry/retry.cpp +++ b/library/cpp/retry/retry.cpp @@ -1,10 +1,10 @@ -#include "retry.h" - -#include <util/stream/output.h> - +#include "retry.h" + +#include <util/stream/output.h> + void DoWithRetry(std::function<void()> func, TRetryOptions retryOptions) { - DoWithRetry(func, retryOptions, true); -} + DoWithRetry(func, retryOptions, true); +} bool DoWithRetryOnRetCode(std::function<bool()> func, TRetryOptions retryOptions) { for (ui32 attempt = 0; attempt <= retryOptions.RetryCount; ++attempt) { diff --git a/library/cpp/retry/retry.h b/library/cpp/retry/retry.h index dc70f953b0..c47ff5070f 100644 --- a/library/cpp/retry/retry.h +++ b/library/cpp/retry/retry.h @@ -1,15 +1,15 @@ -#pragma once - +#pragma once + #include "utils.h" #include <library/cpp/retry/protos/retry_options.pb.h> -#include <util/datetime/base.h> -#include <util/generic/maybe.h> -#include <util/generic/typetraits.h> -#include <util/generic/yexception.h> +#include <util/datetime/base.h> +#include <util/generic/maybe.h> +#include <util/generic/typetraits.h> +#include <util/generic/yexception.h> #include <functional> - + struct TRetryOptions { ui32 RetryCount; @@ -18,7 +18,7 @@ struct TRetryOptions { TDuration SleepRandomDelta; TDuration SleepIncrement; TDuration SleepExponentialMultiplier; - + std::function<void(TDuration)> SleepFunction; TRetryOptions(ui32 retryCount = 3, TDuration sleepDuration = TDuration::Seconds(1), TDuration sleepRandomDelta = TDuration::Zero(), @@ -32,17 +32,17 @@ struct TRetryOptions { , SleepFunction(sleepFunction) { } - + TRetryOptions& WithCount(ui32 retryCount) { RetryCount = retryCount; return *this; } - + TRetryOptions& WithSleep(TDuration sleepDuration) { SleepDuration = sleepDuration; return *this; } - + TRetryOptions& WithRandomDelta(TDuration sleepRandomDelta) { SleepRandomDelta = sleepRandomDelta; return *this; @@ -71,16 +71,16 @@ struct TRetryOptions { static TRetryOptions Count(ui32 retryCount) { return TRetryOptions(retryCount); } - + static TRetryOptions Default() { return TRetryOptions(); - } - + } + static TRetryOptions NoRetry() { return TRetryOptions(0); - } + } }; - + template <typename TResult, typename TException = yexception> TMaybe<TResult> DoWithRetry(std::function<TResult()> func, std::function<void(const TException&)> onFail, TRetryOptions retryOptions, bool throwLast) { for (ui32 attempt = 0; attempt <= retryOptions.RetryCount; ++attempt) { @@ -91,16 +91,16 @@ TMaybe<TResult> DoWithRetry(std::function<TResult()> func, std::function<void(co if (attempt == retryOptions.RetryCount) { if (throwLast) { throw; - } + } } else { auto sleep = retryOptions.SleepFunction; sleep(retryOptions.GetTimeToSleep(attempt)); - } - } - } + } + } + } return Nothing(); } - + template <typename TResult, typename TException = yexception> TMaybe<TResult> DoWithRetry(std::function<TResult()> func, TRetryOptions retryOptions, bool throwLast) { return DoWithRetry<TResult, TException>(func, [](const TException&){}, retryOptions, throwLast); @@ -123,9 +123,9 @@ bool DoWithRetry(std::function<void()> func, TRetryOptions retryOptions, bool th }; return DoWithRetry<void*, TException>(f, [](const TException&){}, retryOptions, throwLast).Defined(); } - + void DoWithRetry(std::function<void()> func, TRetryOptions retryOptions); - + bool DoWithRetryOnRetCode(std::function<bool()> func, TRetryOptions retryOptions); Y_DECLARE_PODTYPE(TRetryOptions); |