diff options
author | dvorkanton <dvorkanton@yandex-team.ru> | 2022-02-10 16:46:04 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:04 +0300 |
commit | 110a978b66fe6c0916572df51cfead2a9b647174 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util | |
parent | ce1ca0f8ad5b8231d32b35629f85bb09beea1bfb (diff) | |
download | ydb-110a978b66fe6c0916572df51cfead2a9b647174.tar.gz |
Restoring authorship annotation for <dvorkanton@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util')
-rw-r--r-- | util/generic/vector.h | 2 | ||||
-rw-r--r-- | util/generic/vector_ut.cpp | 34 | ||||
-rw-r--r-- | util/system/atomic_win.h | 2 | ||||
-rw-r--r-- | util/system/fs.cpp | 2 |
4 files changed, 20 insertions, 20 deletions
diff --git a/util/generic/vector.h b/util/generic/vector.h index 3426252d3a..a5b258955a 100644 --- a/util/generic/vector.h +++ b/util/generic/vector.h @@ -126,7 +126,7 @@ public: inline void crop(size_type size) { if (this->size() > size) { - this->erase(this->begin() + size, this->end()); + this->erase(this->begin() + size, this->end()); } } }; diff --git a/util/generic/vector_ut.cpp b/util/generic/vector_ut.cpp index c23f719621..0f6b4037a0 100644 --- a/util/generic/vector_ut.cpp +++ b/util/generic/vector_ut.cpp @@ -28,7 +28,7 @@ class TYVectorTest: public TTestBase { //UNIT_TEST(TestEbo) UNIT_TEST(TestFillInConstructor) UNIT_TEST(TestYResize) - UNIT_TEST(TestCrop) + UNIT_TEST(TestCrop) UNIT_TEST(TestInitializeList) UNIT_TEST_SUITE_END(); @@ -535,29 +535,29 @@ private: } } - struct TNoDefaultConstructor { - TNoDefaultConstructor() = delete; + struct TNoDefaultConstructor { + TNoDefaultConstructor() = delete; explicit TNoDefaultConstructor(int val) : Val(val) { } - - int Val; - }; - - void TestCrop() { - TVector<TNoDefaultConstructor> vec; - vec.emplace_back(42); - vec.emplace_back(1337); - vec.emplace_back(8888); - vec.crop(1); // Should not require default constructor - UNIT_ASSERT(vec.size() == 1); - UNIT_ASSERT(vec[0].Val == 42); + + int Val; + }; + + void TestCrop() { + TVector<TNoDefaultConstructor> vec; + vec.emplace_back(42); + vec.emplace_back(1337); + vec.emplace_back(8888); + vec.crop(1); // Should not require default constructor + UNIT_ASSERT(vec.size() == 1); + UNIT_ASSERT(vec[0].Val == 42); vec.crop(50); // Does nothing if new size is greater than the current size() UNIT_ASSERT(vec.size() == 1); UNIT_ASSERT(vec[0].Val == 42); - } - + } + void TestYResize() { TestYResize<int>(); TestYResize<TPod>(); diff --git a/util/system/atomic_win.h b/util/system/atomic_win.h index 01a7cd230c..65c290e6cc 100644 --- a/util/system/atomic_win.h +++ b/util/system/atomic_win.h @@ -44,7 +44,7 @@ static inline bool AtomicCas(TAtomic* a, intptr_t exchange, intptr_t compare) { return _InterlockedCompareExchange((volatile long*)a, exchange, compare) == compare; } -static inline intptr_t AtomicGetAndCas(TAtomic* a, intptr_t exchange, intptr_t compare) { +static inline intptr_t AtomicGetAndCas(TAtomic* a, intptr_t exchange, intptr_t compare) { return _InterlockedCompareExchange((volatile long*)a, exchange, compare); } diff --git a/util/system/fs.cpp b/util/system/fs.cpp index c2b1ee226b..d2611a8ccc 100644 --- a/util/system/fs.cpp +++ b/util/system/fs.cpp @@ -122,7 +122,7 @@ TString NFs::ReadLink(const TString& path) { while (true) { ssize_t r = readlink(path.data(), buf.Data(), buf.Size()); if (r < 0) { - ythrow yexception() << "can't read link " << path << ", errno = " << errno; + ythrow yexception() << "can't read link " << path << ", errno = " << errno; } if (r < (ssize_t)buf.Size()) { return TString(buf.Data(), r); |