diff options
author | a-romanov <a-romanov@yandex-team.ru> | 2022-02-10 16:48:10 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:10 +0300 |
commit | aa2986a34bde73b2cdcea5080c4443b7cf2ba686 (patch) | |
tree | 410fbde59311309b774a0da147f79628c3429a2c /util | |
parent | e77cfd118321c5b9c168fdee41b4e6c5706b8f68 (diff) | |
download | ydb-aa2986a34bde73b2cdcea5080c4443b7cf2ba686.tar.gz |
Restoring authorship annotation for <a-romanov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util')
32 files changed, 134 insertions, 134 deletions
diff --git a/util/generic/bt_exception.h b/util/generic/bt_exception.h index 018d2bc89a..72acee7d53 100644 --- a/util/generic/bt_exception.h +++ b/util/generic/bt_exception.h @@ -1,6 +1,6 @@ #pragma once -#include <utility> +#include <utility> #include "yexception.h" #include <util/system/backtrace.h> @@ -10,7 +10,7 @@ class TWithBackTrace: public T { public: template <typename... Args> inline TWithBackTrace(Args&&... args) - : T(std::forward<Args>(args)...) + : T(std::forward<Args>(args)...) { BT_.Capture(); } diff --git a/util/generic/buffer.cpp b/util/generic/buffer.cpp index b92697e1d0..eac45a1248 100644 --- a/util/generic/buffer.cpp +++ b/util/generic/buffer.cpp @@ -58,20 +58,20 @@ void TBuffer::Append(const char* buf, size_t len) { Y_ASSERT(Pos_ <= Len_); } -void TBuffer::Fill(char ch, size_t len) { - if (len > Avail()) { - Reserve(Pos_ + len); - } - - Y_ASSERT(len <= Avail()); - - memset(Data() + Pos_, ch, len); - NSan::Unpoison(Data() + Pos_, len); - Pos_ += len; - - Y_ASSERT(Pos_ <= Len_); -} - +void TBuffer::Fill(char ch, size_t len) { + if (len > Avail()) { + Reserve(Pos_ + len); + } + + Y_ASSERT(len <= Avail()); + + memset(Data() + Pos_, ch, len); + NSan::Unpoison(Data() + Pos_, len); + Pos_ += len; + + Y_ASSERT(Pos_ <= Len_); +} + void TBuffer::DoReserve(size_t realLen) { // FastClp2<T>(x) returns 0 on x from [Max<T>/2 + 2, Max<T>] const size_t len = Max<size_t>(FastClp2(realLen), realLen); diff --git a/util/generic/buffer.h b/util/generic/buffer.h index 9576467404..ccedad535e 100644 --- a/util/generic/buffer.h +++ b/util/generic/buffer.h @@ -106,30 +106,30 @@ public: *(Data() + Pos_++) = ch; } - void Fill(char ch, size_t len); - + void Fill(char ch, size_t len); + // Method is useful when first messages from buffer are processed, and // the last message in buffer is incomplete, so we need to move partial // message to the begin of the buffer and continue filling the buffer // from the network. - inline void Chop(size_t pos, size_t count) { - const auto end = pos + count; - Y_ASSERT(end <= Pos_); + inline void Chop(size_t pos, size_t count) { + const auto end = pos + count; + Y_ASSERT(end <= Pos_); if (count == 0) { return; } else if (count == Pos_) { Pos_ = 0; } else { - memmove(Data_ + pos, Data_ + end, Pos_ - end); - Pos_ -= count; + memmove(Data_ + pos, Data_ + end, Pos_ - end); + Pos_ -= count; } } - inline void ChopHead(size_t count) { - Chop(0U, count); - } - + inline void ChopHead(size_t count) { + Chop(0U, count); + } + inline void Proceed(size_t pos) { //Y_ASSERT(pos <= Len_); // see discussion in REVIEW:29021 Resize(pos); diff --git a/util/generic/buffer_ut.cpp b/util/generic/buffer_ut.cpp index 437d7122ec..46da4d8674 100644 --- a/util/generic/buffer_ut.cpp +++ b/util/generic/buffer_ut.cpp @@ -178,14 +178,14 @@ Y_UNIT_TEST(TestSpeed) { UNIT_ASSERT(t1 < t2); } #endif - + Y_UNIT_TEST(TestFillAndChop) { TBuffer buf; buf.Append("Some ", 5); buf.Fill('!', 5); buf.Append(" text.", 6); UNIT_ASSERT_VALUES_EQUAL(TString(buf.data(), buf.size()), "Some !!!!! text."); - + buf.Chop(5, 6); UNIT_ASSERT_VALUES_EQUAL(TString(buf.data(), buf.size()), "Some text."); } diff --git a/util/generic/deque_ut.cpp b/util/generic/deque_ut.cpp index 93bf50fa92..62665ce409 100644 --- a/util/generic/deque_ut.cpp +++ b/util/generic/deque_ut.cpp @@ -2,7 +2,7 @@ #include <library/cpp/testing/unittest/registar.h> -#include <utility> +#include <utility> #include "yexception.h" class TDequeTest: public TTestBase { @@ -40,7 +40,7 @@ void TDequeTest::TestConstructorsAndAssignments() { UNIT_ASSERT_VALUES_EQUAL(100, c1.at(0)); UNIT_ASSERT_VALUES_EQUAL(200, c2.at(1)); - container c3(std::move(c1)); + container c3(std::move(c1)); UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); @@ -54,7 +54,7 @@ void TDequeTest::TestConstructorsAndAssignments() { UNIT_ASSERT_VALUES_EQUAL(300, c3.at(2)); c2.push_back(400); - c3 = std::move(c2); + c3 = std::move(c2); UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); diff --git a/util/generic/function_ut.cpp b/util/generic/function_ut.cpp index 3880295a9f..903a581fea 100644 --- a/util/generic/function_ut.cpp +++ b/util/generic/function_ut.cpp @@ -35,7 +35,7 @@ Y_UNIT_TEST_SUITE(TestFunctionSignature) { } Y_UNIT_TEST(TestFunction) { - std::function<int(double)> f(FF); + std::function<int(double)> f(FF); UNIT_ASSERT_TYPES_EQUAL(TFunctionSignature<decltype(f)>, decltype(FF)); } diff --git a/util/generic/hash.h b/util/generic/hash.h index e46db21fa9..f590fbb2cb 100644 --- a/util/generic/hash.h +++ b/util/generic/hash.h @@ -463,7 +463,7 @@ public: using hasher = HashFcn; using key_equal = EqualKey; using key_extract = ExtractKey; - using allocator_type = Alloc; + using allocator_type = Alloc; using node_allocator_type = typename traits_type::node_allocator_type; using size_type = size_t; @@ -482,7 +482,7 @@ public: key_equal key_eq() const { return this->_get_key_eq(); } - hasher hash_function() const { + hasher hash_function() const { return this->_get_hash_fun(); } @@ -659,7 +659,7 @@ public: return buckets.size(); } /*y*/ - size_type bucket_size(size_type bucket) const { + size_type bucket_size(size_type bucket) const { size_type result = 0; if (const node* cur = buckets[bucket]) for (; !((uintptr_t)cur & 1); cur = cur->next) @@ -669,19 +669,19 @@ public: template <class OtherValue> std::pair<iterator, bool> insert_unique(const OtherValue& obj) { - reserve(num_elements + 1); + reserve(num_elements + 1); return insert_unique_noresize(obj); } template <class OtherValue> iterator insert_equal(const OtherValue& obj) { - reserve(num_elements + 1); + reserve(num_elements + 1); return emplace_equal_noresize(obj); } template <typename... Args> iterator emplace_equal(Args&&... args) { - reserve(num_elements + 1); + reserve(num_elements + 1); return emplace_equal_noresize(std::forward<Args>(args)...); } @@ -692,7 +692,7 @@ public: template <typename... Args> iterator emplace_direct(insert_ctx ins, Args&&... args) { - bool resized = reserve(num_elements + 1); + bool resized = reserve(num_elements + 1); node* tmp = new_node(std::forward<Args>(args)...); if (resized) { find_i(get_key(tmp->val), ins); @@ -705,7 +705,7 @@ public: template <typename... Args> std::pair<iterator, bool> emplace_unique(Args&&... args) { - reserve(num_elements + 1); + reserve(num_elements + 1); return emplace_unique_noresize(std::forward<Args>(args)...); } @@ -744,7 +744,7 @@ public: void insert_unique(ForwardIterator f, ForwardIterator l, std::forward_iterator_tag) { difference_type n = std::distance(f, l); - reserve(num_elements + n); + reserve(num_elements + n); for (; n > 0; --n, ++f) insert_unique_noresize(*f); } @@ -753,7 +753,7 @@ public: void insert_equal(ForwardIterator f, ForwardIterator l, std::forward_iterator_tag) { difference_type n = std::distance(f, l); - reserve(num_elements + n); + reserve(num_elements + n); for (; n > 0; --n, ++f) emplace_equal_noresize(*f); } @@ -819,7 +819,7 @@ public: void erase(const const_iterator& it); void erase(const_iterator first, const_iterator last); - bool reserve(size_type num_elements_hint); + bool reserve(size_type num_elements_hint); void basic_clear(); /** @@ -1065,7 +1065,7 @@ __yhashtable_iterator<V> THashTable<V, K, HF, Ex, Eq, A>::emplace_equal_noresize template <class V, class K, class HF, class Ex, class Eq, class A> template <class OtherValue> typename THashTable<V, K, HF, Ex, Eq, A>::reference THashTable<V, K, HF, Ex, Eq, A>::find_or_insert(const OtherValue& v) { - reserve(num_elements + 1); + reserve(num_elements + 1); size_type n = bkt_num_key(get_key(v)); node* first = buckets[n]; @@ -1432,7 +1432,7 @@ public: using value_type = typename ht::value_type; using hasher = typename ht::hasher; using key_equal = typename ht::key_equal; - using allocator_type = typename ht::allocator_type; + using allocator_type = typename ht::allocator_type; using node_allocator_type = typename ht::node_allocator_type; using mapped_type = T; @@ -1447,8 +1447,8 @@ public: using const_iterator = typename ht::const_iterator; using insert_ctx = typename ht::insert_ctx; - hasher hash_function() const { - return rep.hash_function(); + hasher hash_function() const { + return rep.hash_function(); } key_equal key_eq() const { return rep.key_eq(); @@ -1717,14 +1717,14 @@ public: } public: - void reserve(size_type hint) { - rep.reserve(hint); + void reserve(size_type hint) { + rep.reserve(hint); } size_type bucket_count() const { return rep.bucket_count(); } - size_type bucket_size(size_type n) const { - return rep.bucket_size(n); + size_type bucket_size(size_type n) const { + return rep.bucket_size(n); } node_allocator_type& GetNodeAllocator() { return rep.GetNodeAllocator(); @@ -1765,7 +1765,7 @@ public: using hasher = typename ht::hasher; using key_equal = typename ht::key_equal; using mapped_type = T; - using allocator_type = typename ht::allocator_type; + using allocator_type = typename ht::allocator_type; using size_type = typename ht::size_type; using difference_type = typename ht::difference_type; @@ -1778,8 +1778,8 @@ public: using const_iterator = typename ht::const_iterator; using insert_ctx = typename ht::insert_ctx; - hasher hash_function() const { - return rep.hash_function(); + hasher hash_function() const { + return rep.hash_function(); } key_equal key_eq() const { return rep.key_eq(); @@ -1983,14 +1983,14 @@ public: } public: - void reserve(size_type hint) { - rep.reserve(hint); + void reserve(size_type hint) { + rep.reserve(hint); } size_type bucket_count() const { return rep.bucket_count(); } - size_type bucket_size(size_type n) const { - return rep.bucket_size(n); + size_type bucket_size(size_type n) const { + return rep.bucket_size(n); } }; diff --git a/util/generic/hash_set.h b/util/generic/hash_set.h index e8088cf23b..dc9cfda3a9 100644 --- a/util/generic/hash_set.h +++ b/util/generic/hash_set.h @@ -21,7 +21,7 @@ public: using value_type = typename ht::value_type; using hasher = typename ht::hasher; using key_equal = typename ht::key_equal; - using allocator_type = typename ht::allocator_type; + using allocator_type = typename ht::allocator_type; using node_allocator_type = typename ht::node_allocator_type; using size_type = typename ht::size_type; @@ -35,8 +35,8 @@ public: using const_iterator = typename ht::const_iterator; using insert_ctx = typename ht::insert_ctx; - hasher hash_function() const { - return rep.hash_function(); + hasher hash_function() const { + return rep.hash_function(); } key_equal key_eq() const { return rep.key_eq(); @@ -246,14 +246,14 @@ public: } public: - void reserve(size_type hint) { - rep.reserve(hint); + void reserve(size_type hint) { + rep.reserve(hint); } size_type bucket_count() const { return rep.bucket_count(); } - size_type bucket_size(size_type n) const { - return rep.bucket_size(n); + size_type bucket_size(size_type n) const { + return rep.bucket_size(n); } node_allocator_type& GetNodeAllocator() { return rep.GetNodeAllocator(); @@ -289,7 +289,7 @@ public: using value_type = typename ht::value_type; using hasher = typename ht::hasher; using key_equal = typename ht::key_equal; - using allocator_type = typename ht::allocator_type; + using allocator_type = typename ht::allocator_type; using node_allocator_type = typename ht::node_allocator_type; using size_type = typename ht::size_type; @@ -302,8 +302,8 @@ public: using iterator = typename ht::const_iterator; using const_iterator = typename ht::const_iterator; - hasher hash_function() const { - return rep.hash_function(); + hasher hash_function() const { + return rep.hash_function(); } key_equal key_eq() const { return rep.key_eq(); @@ -449,14 +449,14 @@ public: } public: - void reserve(size_type hint) { - rep.reserve(hint); + void reserve(size_type hint) { + rep.reserve(hint); } size_type bucket_count() const { return rep.bucket_count(); } - size_type bucket_size(size_type n) const { - return rep.bucket_size(n); + size_type bucket_size(size_type n) const { + return rep.bucket_size(n); } node_allocator_type& GetNodeAllocator() { return rep.GetNodeAllocator(); diff --git a/util/generic/hash_ut.cpp b/util/generic/hash_ut.cpp index 0551d58770..9d52acafb4 100644 --- a/util/generic/hash_ut.cpp +++ b/util/generic/hash_ut.cpp @@ -5,7 +5,7 @@ #include <library/cpp/testing/common/probe.h> #include <library/cpp/testing/unittest/registar.h> -#include <utility> +#include <utility> #include <util/str_stl.h> #include <util/digest/multi.h> @@ -128,7 +128,7 @@ void THashTest::TestHMapConstructorsAndAssignments() { UNIT_ASSERT_VALUES_EQUAL(1, c1.at("one")); /* Note: fails under MSVC since it does not support implicit generation of move constructors. */ UNIT_ASSERT_VALUES_EQUAL(2, c2.at("two")); - container c3(std::move(c1)); + container c3(std::move(c1)); UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); @@ -142,7 +142,7 @@ void THashTest::TestHMapConstructorsAndAssignments() { UNIT_ASSERT_VALUES_EQUAL(3, c3.at("three")); c2["four"] = 4; - c3 = std::move(c2); + c3 = std::move(c2); UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); @@ -272,7 +272,7 @@ void THashTest::TestHMMapConstructorsAndAssignments() { UNIT_ASSERT_VALUES_EQUAL(2, c1.size()); UNIT_ASSERT_VALUES_EQUAL(2, c2.size()); - container c3(std::move(c1)); + container c3(std::move(c1)); UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); @@ -284,7 +284,7 @@ void THashTest::TestHMMapConstructorsAndAssignments() { UNIT_ASSERT_VALUES_EQUAL(3, c3.size()); c2.insert(container::value_type("four", 4)); - c3 = std::move(c2); + c3 = std::move(c2); UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); @@ -380,7 +380,7 @@ void THashTest::TestHSetConstructorsAndAssignments() { UNIT_ASSERT(c1.contains(100)); UNIT_ASSERT(c2.contains(200)); - container c3(std::move(c1)); + container c3(std::move(c1)); UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); @@ -394,7 +394,7 @@ void THashTest::TestHSetConstructorsAndAssignments() { UNIT_ASSERT(c3.contains(300)); c2.insert(400); - c3 = std::move(c2); + c3 = std::move(c2); UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); @@ -471,7 +471,7 @@ void THashTest::TestHMSetConstructorsAndAssignments() { UNIT_ASSERT(c1.find(100) != c1.end()); UNIT_ASSERT(c2.find(200) != c2.end()); - container c3(std::move(c1)); + container c3(std::move(c1)); UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); @@ -485,7 +485,7 @@ void THashTest::TestHMSetConstructorsAndAssignments() { UNIT_ASSERT(c3.find(300) != c3.end()); c2.insert(400); - c3 = std::move(c2); + c3 = std::move(c2); UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); diff --git a/util/generic/lazy_value.h b/util/generic/lazy_value.h index 3c720f76b5..368689a147 100644 --- a/util/generic/lazy_value.h +++ b/util/generic/lazy_value.h @@ -6,7 +6,7 @@ template <class T> class TLazyValueBase { public: - using TInitializer = std::function<T()>; + using TInitializer = std::function<T()>; TLazyValueBase() = default; diff --git a/util/generic/maybe.h b/util/generic/maybe.h index 34d21aebcd..b306726214 100644 --- a/util/generic/maybe.h +++ b/util/generic/maybe.h @@ -1,6 +1,6 @@ #pragma once -#include <utility> +#include <utility> #include "maybe_traits.h" #include "yexception.h" @@ -443,7 +443,7 @@ private: template <typename... Args> void Init(Args&&... args) { - new (Data()) T(std::forward<Args>(args)...); + new (Data()) T(std::forward<Args>(args)...); this->Defined_ = true; } }; diff --git a/util/generic/ptr.h b/util/generic/ptr.h index 19db0e3ec5..9150e62d6f 100644 --- a/util/generic/ptr.h +++ b/util/generic/ptr.h @@ -7,7 +7,7 @@ #include "typetraits.h" #include "singleton.h" -#include <utility> +#include <utility> #include <util/system/yassert.h> #include <util/system/defaults.h> @@ -780,7 +780,7 @@ typename TSimpleIntrusiveOps<T, Ops>::TFunc TSimpleIntrusiveOps<T, Ops>::UnRef_ template <typename T, class Ops = TDefaultIntrusivePtrOps<T>, typename... Args> [[nodiscard]] TIntrusivePtr<T, Ops> MakeIntrusive(Args&&... args) { - return new T{std::forward<Args>(args)...}; + return new T{std::forward<Args>(args)...}; } template <typename T, class Ops = TDefaultIntrusivePtrOps<T>, typename... Args> @@ -949,17 +949,17 @@ using TSimpleSharedPtr = TSharedPtr<T, TSimpleCounter, D>; template <typename T, typename C, typename... Args> [[nodiscard]] TSharedPtr<T, C> MakeShared(Args&&... args) { - return new T{std::forward<Args>(args)...}; + return new T{std::forward<Args>(args)...}; } template <typename T, typename... Args> [[nodiscard]] inline TAtomicSharedPtr<T> MakeAtomicShared(Args&&... args) { - return MakeShared<T, TAtomicCounter>(std::forward<Args>(args)...); + return MakeShared<T, TAtomicCounter>(std::forward<Args>(args)...); } template <typename T, typename... Args> [[nodiscard]] inline TSimpleSharedPtr<T> MakeSimpleShared(Args&&... args) { - return MakeShared<T, TSimpleCounter>(std::forward<Args>(args)...); + return MakeShared<T, TSimpleCounter>(std::forward<Args>(args)...); } class TCopyClone { diff --git a/util/generic/queue_ut.cpp b/util/generic/queue_ut.cpp index a33399e104..96e40224ca 100644 --- a/util/generic/queue_ut.cpp +++ b/util/generic/queue_ut.cpp @@ -4,7 +4,7 @@ #include <library/cpp/testing/unittest/registar.h> -#include <utility> +#include <utility> Y_UNIT_TEST_SUITE(TYQueueTest) { Y_UNIT_TEST(ConstructorsAndAssignments) { @@ -22,7 +22,7 @@ Y_UNIT_TEST_SUITE(TYQueueTest) { UNIT_ASSERT_VALUES_EQUAL(2, c1.size()); UNIT_ASSERT_VALUES_EQUAL(2, c2.size()); - container c3(std::move(c1)); + container c3(std::move(c1)); UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); @@ -34,7 +34,7 @@ Y_UNIT_TEST_SUITE(TYQueueTest) { UNIT_ASSERT_VALUES_EQUAL(3, c3.size()); c2.push(400); - c3 = std::move(c2); + c3 = std::move(c2); UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); @@ -54,7 +54,7 @@ Y_UNIT_TEST_SUITE(TYQueueTest) { UNIT_ASSERT_VALUES_EQUAL(2, c1.size()); UNIT_ASSERT_VALUES_EQUAL(2, c2.size()); - container c3(std::move(c1)); + container c3(std::move(c1)); UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); @@ -66,7 +66,7 @@ Y_UNIT_TEST_SUITE(TYQueueTest) { UNIT_ASSERT_VALUES_EQUAL(3, c3.size()); c2.push(400); - c3 = std::move(c2); + c3 = std::move(c2); UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); diff --git a/util/generic/set_ut.cpp b/util/generic/set_ut.cpp index d2769d327f..825840630a 100644 --- a/util/generic/set_ut.cpp +++ b/util/generic/set_ut.cpp @@ -2,7 +2,7 @@ #include <library/cpp/testing/unittest/registar.h> -#include <utility> +#include <utility> #include <algorithm> @@ -206,7 +206,7 @@ Y_UNIT_TEST_SUITE(YSetTest) { UNIT_ASSERT(c1.contains(100)); UNIT_ASSERT(c2.contains(200)); - container c3(std::move(c1)); + container c3(std::move(c1)); UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); @@ -220,7 +220,7 @@ Y_UNIT_TEST_SUITE(YSetTest) { UNIT_ASSERT(c3.contains(300)); c2.insert(400); - c3 = std::move(c2); + c3 = std::move(c2); UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); @@ -241,7 +241,7 @@ Y_UNIT_TEST_SUITE(YSetTest) { UNIT_ASSERT(c1.find(100) != c1.end()); UNIT_ASSERT(c2.find(200) != c2.end()); - container c3(std::move(c1)); + container c3(std::move(c1)); UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); @@ -255,7 +255,7 @@ Y_UNIT_TEST_SUITE(YSetTest) { UNIT_ASSERT(c3.find(300) != c3.end()); c2.insert(400); - c3 = std::move(c2); + c3 = std::move(c2); UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); diff --git a/util/generic/store_policy.h b/util/generic/store_policy.h index 148821c70c..10d8ecb0a7 100644 --- a/util/generic/store_policy.h +++ b/util/generic/store_policy.h @@ -1,13 +1,13 @@ #pragma once -#include <utility> +#include <utility> #include "ptr.h" template <class TBase, class TCounter> struct TWithRefCount: public TBase, public TRefCounted<TWithRefCount<TBase, TCounter>, TCounter> { template <typename... Args> inline TWithRefCount(Args&&... args) - : TBase(std::forward<Args>(args)...) + : TBase(std::forward<Args>(args)...) { } }; @@ -34,7 +34,7 @@ template <class T> struct TEmbedPolicy { template <typename... Args> inline TEmbedPolicy(Args&&... args) - : T_(std::forward<Args>(args)...) + : T_(std::forward<Args>(args)...) { } @@ -55,7 +55,7 @@ struct TRefPolicy { template <typename... Args> inline TRefPolicy(Args&&... args) - : T_(new THelper(std::forward<Args>(args)...)) + : T_(new THelper(std::forward<Args>(args)...)) { } diff --git a/util/generic/vector_ut.cpp b/util/generic/vector_ut.cpp index 0f6b4037a0..dbb51ac5fc 100644 --- a/util/generic/vector_ut.cpp +++ b/util/generic/vector_ut.cpp @@ -2,7 +2,7 @@ #include <library/cpp/testing/unittest/registar.h> -#include <utility> +#include <utility> #include "yexception.h" #include <stdexcept> @@ -47,7 +47,7 @@ private: UNIT_ASSERT_VALUES_EQUAL(100, c1.at(0)); UNIT_ASSERT_VALUES_EQUAL(200, c2.at(1)); - container c3(std::move(c1)); + container c3(std::move(c1)); UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); @@ -61,7 +61,7 @@ private: UNIT_ASSERT_VALUES_EQUAL(300, c3.at(2)); c2.push_back(400); - c3 = std::move(c2); + c3 = std::move(c2); UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); diff --git a/util/generic/yexception.h b/util/generic/yexception.h index b0c604e8c4..e4f1129524 100644 --- a/util/generic/yexception.h +++ b/util/generic/yexception.h @@ -5,7 +5,7 @@ #include "string.h" #include "utility.h" #include "va_args.h" -#include <utility> +#include <utility> #include <util/stream/tempbuf.h> #include <util/system/compat.h> @@ -70,7 +70,7 @@ namespace NPrivateException { operator<<(E&& e, const T& t) { e.Append(t); - return std::forward<E>(e); + return std::forward<E>(e); } template <class T> diff --git a/util/memory/pool.h b/util/memory/pool.h index 13c8b6b9ed..efc20f0fc5 100644 --- a/util/memory/pool.h +++ b/util/memory/pool.h @@ -12,7 +12,7 @@ #include <new> #include <string> -#include <utility> +#include <utility> /** * Memory pool implements a memory allocation scheme that is very fast, but @@ -191,7 +191,7 @@ public: template <typename T, typename... Args> inline T* New(Args&&... args) { - return new (Allocate<T>()) T(std::forward<Args>(args)...); + return new (Allocate<T>()) T(std::forward<Args>(args)...); } template <typename T> diff --git a/util/memory/tempbuf.cpp b/util/memory/tempbuf.cpp index 09a2d0f140..6c60ebaf71 100644 --- a/util/memory/tempbuf.cpp +++ b/util/memory/tempbuf.cpp @@ -7,7 +7,7 @@ #include <util/generic/intrlist.h> #include <util/generic/singleton.h> #include <util/generic/yexception.h> -#include <utility> +#include <utility> #include <util/thread/singleton.h> #ifndef TMP_BUF_LEN @@ -197,7 +197,7 @@ TTempBuf::TTempBuf(size_t len) TTempBuf::TTempBuf(const TTempBuf&) noexcept = default; TTempBuf::TTempBuf(TTempBuf&& b) noexcept - : Impl_(std::move(b.Impl_)) + : Impl_(std::move(b.Impl_)) { } diff --git a/util/memory/tempbuf_ut.cpp b/util/memory/tempbuf_ut.cpp index d6bcf9d546..b4774b7b05 100644 --- a/util/memory/tempbuf_ut.cpp +++ b/util/memory/tempbuf_ut.cpp @@ -1,6 +1,6 @@ #include "tempbuf.h" -#include <utility> +#include <utility> #include <library/cpp/testing/unittest/registar.h> @@ -71,7 +71,7 @@ void TTempBufTest::TestMoveCtor() { src.Proceed(10); - TTempBuf dst(std::move(src)); + TTempBuf dst(std::move(src)); UNIT_ASSERT(src.IsNull()); UNIT_ASSERT(!dst.IsNull()); diff --git a/util/random/lcg_engine.h b/util/random/lcg_engine.h index 08cc93c845..8cb8431c55 100644 --- a/util/random/lcg_engine.h +++ b/util/random/lcg_engine.h @@ -1,6 +1,6 @@ #pragma once -#include <utility> +#include <utility> #include <util/generic/typetraits.h> // common engine for lcg-based RNG's @@ -49,7 +49,7 @@ struct TLcgRngBase: public TIterator, public TMixer { template <typename... Args> inline TLcgRngBase(TStateType seed, Args&&... args) - : TIterator(std::forward<Args>(args)...) + : TIterator(std::forward<Args>(args)...) , X(seed) { } diff --git a/util/stream/buffered.h b/util/stream/buffered.h index 0847186141..6ca2939508 100644 --- a/util/stream/buffered.h +++ b/util/stream/buffered.h @@ -3,7 +3,7 @@ #include "zerocopy.h" #include "zerocopy_output.h" -#include <utility> +#include <utility> #include <util/generic/ptr.h> #include <util/generic/typetraits.h> #include <util/generic/store_policy.h> @@ -188,7 +188,7 @@ class TBuffered: private TEmbedPolicy<TSlave>, public ::NPrivate::TBufferedStrea public: template <typename... Args> inline TBuffered(size_t b, Args&&... args) - : TSlaveBase(std::forward<Args>(args)...) + : TSlaveBase(std::forward<Args>(args)...) , TBufferedBase(TSlaveBase::Ptr(), b) { } @@ -221,7 +221,7 @@ class TAdaptivelyBuffered: private TEmbedPolicy<TSlave>, public TAdaptiveBuffere public: template <typename... Args> inline TAdaptivelyBuffered(Args&&... args) - : TSlaveBase(std::forward<Args>(args)...) + : TSlaveBase(std::forward<Args>(args)...) , TAdaptiveBufferedOutput(TSlaveBase::Ptr()) { } diff --git a/util/stream/file.h b/util/stream/file.h index c1cf4f591d..3e4865c1cd 100644 --- a/util/stream/file.h +++ b/util/stream/file.h @@ -7,7 +7,7 @@ #include "mem.h" #include <util/system/file.h> -#include <utility> +#include <utility> /** * @addtogroup Streams_Files diff --git a/util/stream/holder.h b/util/stream/holder.h index c60a4e510c..0795320455 100644 --- a/util/stream/holder.h +++ b/util/stream/holder.h @@ -2,7 +2,7 @@ #include <util/generic/ptr.h> -#include <utility> +#include <utility> #include <type_traits> class IInputStream; diff --git a/util/string/builder.h b/util/string/builder.h index 7b54821151..bff7909974 100644 --- a/util/string/builder.h +++ b/util/string/builder.h @@ -1,7 +1,7 @@ #pragma once #include <util/stream/str.h> -#include <utility> +#include <utility> #include <util/generic/string.h> namespace NPrivateStringBuilder { @@ -32,7 +32,7 @@ namespace NPrivateStringBuilder { static inline TStringBuilder&& operator<<(TStringBuilder&& builder, const T& t) { builder.Out << t; - return std::move(builder); + return std::move(builder); } } diff --git a/util/string/strip.h b/util/string/strip.h index d5ef6da96d..edba5bb40c 100644 --- a/util/string/strip.h +++ b/util/string/strip.h @@ -4,7 +4,7 @@ #include <util/generic/string.h> #include <util/generic/strbuf.h> -#include <utility> +#include <utility> template <class It> struct TIsAsciiSpaceAdapter { diff --git a/util/thread/factory.cpp b/util/thread/factory.cpp index 48e898f32d..e956b8b098 100644 --- a/util/thread/factory.cpp +++ b/util/thread/factory.cpp @@ -62,7 +62,7 @@ namespace { } private: - std::function<void()> Func; + std::function<void()> Func; }; } diff --git a/util/thread/factory.h b/util/thread/factory.h index 561fcbac88..8f13244e45 100644 --- a/util/thread/factory.h +++ b/util/thread/factory.h @@ -1,7 +1,7 @@ #pragma once #include <util/generic/ptr.h> -#include <functional> +#include <functional> class IThreadFactory { public: diff --git a/util/thread/lfqueue_ut.cpp b/util/thread/lfqueue_ut.cpp index 83bca100cf..454a75cf82 100644 --- a/util/thread/lfqueue_ut.cpp +++ b/util/thread/lfqueue_ut.cpp @@ -1,6 +1,6 @@ #include <library/cpp/threading/future/future.h> #include <library/cpp/testing/unittest/registar.h> - + #include <util/generic/algorithm.h> #include <util/generic/vector.h> #include <util/generic/ptr.h> diff --git a/util/thread/lfstack_ut.cpp b/util/thread/lfstack_ut.cpp index e20a838f95..8fa1037789 100644 --- a/util/thread/lfstack_ut.cpp +++ b/util/thread/lfstack_ut.cpp @@ -1,4 +1,4 @@ - + #include <util/system/atomic.h> #include <util/system/event.h> #include <util/generic/deque.h> @@ -88,11 +88,11 @@ Y_UNIT_TEST_SUITE(TLockFreeStackTests) { TVector<TSimpleSharedPtr<NThreading::TLegacyFuture<>>> futures; for (size_t i = 0; i < EnqueueThreads; ++i) { - futures.push_back(new NThreading::TLegacyFuture<>(std::bind(&TDequeueAllTester<SingleConsumer>::Enqueuer, this))); + futures.push_back(new NThreading::TLegacyFuture<>(std::bind(&TDequeueAllTester<SingleConsumer>::Enqueuer, this))); } for (size_t i = 0; i < DequeueThreads; ++i) { - futures.push_back(new NThreading::TLegacyFuture<>(std::bind(&TDequeueAllTester<SingleConsumer>::DequeuerAll, this))); + futures.push_back(new NThreading::TLegacyFuture<>(std::bind(&TDequeueAllTester<SingleConsumer>::DequeuerAll, this))); } // effectively join diff --git a/util/thread/pool.h b/util/thread/pool.h index d1ea3a67cb..e0583c2a73 100644 --- a/util/thread/pool.h +++ b/util/thread/pool.h @@ -8,7 +8,7 @@ #include <util/generic/yexception.h> #include <util/generic/ptr.h> #include <util/generic/noncopyable.h> -#include <functional> +#include <functional> class TDuration; diff --git a/util/ysaveload.h b/util/ysaveload.h index 02efb4049b..6258df889f 100644 --- a/util/ysaveload.h +++ b/util/ysaveload.h @@ -511,7 +511,7 @@ public: inline TSetSerializerInserter(TMapType& m, size_t cnt) : TBase(m) { - m.reserve(cnt); + m.reserve(cnt); } }; @@ -537,7 +537,7 @@ public: inline TSetSerializerInserter(TSetType& s, size_t cnt) : TBase(s) { - s.reserve(cnt); + s.reserve(cnt); } }; |