aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic
diff options
context:
space:
mode:
authorAlexander Rutkovsky <alexvru@mail.ru>2022-02-10 16:47:39 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:39 +0300
commitf3646f91e0de459836a7800b9ce3e8dc57a2ab3a (patch)
tree25c1423200152570c1f8307e5b8304b9bc3840c5 /util/generic
parentfccc62e9bfdce9be2fe7e0f23479da3a5512211a (diff)
downloadydb-f3646f91e0de459836a7800b9ce3e8dc57a2ab3a.tar.gz
Restoring authorship annotation for Alexander Rutkovsky <alexvru@mail.ru>. Commit 1 of 2.
Diffstat (limited to 'util/generic')
-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 f77d182460..adddfc67f5 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 087d34a8dc..eda5ff256f 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 19db0e3ec5..c5b6c594f5 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