aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorAlexander Rutkovsky <alexvru@mail.ru>2022-02-10 16:47:40 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:40 +0300
commit667a4ee7da2e004784b9c3cfab824a81e96f4d66 (patch)
treec0748b5dcbade83af788c0abfa89c0383d6b779c /util
parentf3646f91e0de459836a7800b9ce3e8dc57a2ab3a (diff)
downloadydb-667a4ee7da2e004784b9c3cfab824a81e96f4d66.tar.gz
Restoring authorship annotation for Alexander Rutkovsky <alexvru@mail.ru>. Commit 2 of 2.
Diffstat (limited to 'util')
-rw-r--r--util/generic/bitmap.h18
-rw-r--r--util/generic/bitmap_ut.cpp24
-rw-r--r--util/generic/ptr.h6
3 files changed, 24 insertions, 24 deletions
diff --git a/util/generic/bitmap.h b/util/generic/bitmap.h
index adddfc67f5..f77d182460 100644
--- a/util/generic/bitmap.h
+++ b/util/generic/bitmap.h
@@ -402,16 +402,16 @@ private:
const size_t endChunk = end >> DivCount;
const size_t endBitOffset = end & ModMask;
- size_t bitOffset = startBitOffset;
- for (size_t chunk = startChunk; chunk <= endChunk; ++chunk) {
- TChunk updateMask = FullChunk << bitOffset;
- if (chunk == endChunk) {
- updateMask ^= FullChunk << endBitOffset;
- if (!updateMask)
- break;
+ size_t bitOffset = startBitOffset;
+ for (size_t chunk = startChunk; chunk <= endChunk; ++chunk) {
+ TChunk updateMask = FullChunk << bitOffset;
+ if (chunk == endChunk) {
+ updateMask ^= FullChunk << endBitOffset;
+ if (!updateMask)
+ break;
}
- Mask.Data[chunk] = TUpdateOp::Op(Mask.Data[chunk], updateMask);
- bitOffset = 0;
+ Mask.Data[chunk] = TUpdateOp::Op(Mask.Data[chunk], updateMask);
+ bitOffset = 0;
}
}
diff --git a/util/generic/bitmap_ut.cpp b/util/generic/bitmap_ut.cpp
index eda5ff256f..087d34a8dc 100644
--- a/util/generic/bitmap_ut.cpp
+++ b/util/generic/bitmap_ut.cpp
@@ -571,19 +571,19 @@ Y_UNIT_TEST_SUITE(TBitMapTest) {
UNIT_ASSERT_EQUAL(TBitMap4Chunks().Flip().Reset(50, 64), TBitMap4Chunks().Set(0, 50));
UNIT_ASSERT_EQUAL(TBitMap4Chunks().Flip().Reset(0, 10).Reset(50, 64), TBitMap4Chunks().Set(10, 50));
}
-
+
Y_UNIT_TEST(TestSetRangeDyn) {
- for (size_t start = 0; start < 192; ++start) {
- for (size_t end = start; end < 192; ++end) {
- TDynBitMap bm;
- bm.Reserve(192);
- bm.Set(start, end);
- for (size_t k = 0; k < 192; ++k) {
- UNIT_ASSERT_VALUES_EQUAL(bm.Get(k), k >= start && k < end ? 1 : 0);
- }
- }
- }
- }
+ for (size_t start = 0; start < 192; ++start) {
+ for (size_t end = start; end < 192; ++end) {
+ TDynBitMap bm;
+ bm.Reserve(192);
+ bm.Set(start, end);
+ for (size_t k = 0; k < 192; ++k) {
+ UNIT_ASSERT_VALUES_EQUAL(bm.Get(k), k >= start && k < end ? 1 : 0);
+ }
+ }
+ }
+ }
Y_UNIT_TEST(TestResetLargeRangeDyn) {
TDynBitMap bm;
diff --git a/util/generic/ptr.h b/util/generic/ptr.h
index c5b6c594f5..19db0e3ec5 100644
--- a/util/generic/ptr.h
+++ b/util/generic/ptr.h
@@ -104,9 +104,9 @@ public:
using TValueType = T;
inline T* operator->() const noexcept {
- T* ptr = AsT();
- Y_ASSERT(ptr);
- return ptr;
+ T* ptr = AsT();
+ Y_ASSERT(ptr);
+ return ptr;
}
#ifndef __cpp_impl_three_way_comparison