Skip to content

Commit b6ea5e5

Browse files
SammyVimesblinkov
authored andcommitted
Make TRope movable in case of vector growing (#14329)
1 parent b63256f commit b6ea5e5

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

ydb/core/blobstorage/vdisk/balance/sender.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ namespace {
4545
[&](TRope&& data) {
4646
// part is already in memory, no need to read it from disk
4747
Y_DEBUG_ABORT_UNLESS(item.PartsMask.CountBits() == 1);
48-
Result[i].PartsData.reserve(1);
4948
Result[i].PartsData.emplace_back(std::move(data));
5049
++Responses;
5150
},

ydb/library/actors/util/rope.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ class TRope {
371371
Chain.PutToEnd(std::move(data));
372372
}
373373

374-
TRope(TRope&& rope)
374+
TRope(TRope&& rope) noexcept
375375
: Chain(std::move(rope.Chain))
376376
, Size(std::exchange(rope.Size, 0))
377377
{
@@ -431,7 +431,7 @@ class TRope {
431431
return *this;
432432
}
433433

434-
TRope& operator=(TRope&& other) {
434+
TRope& operator=(TRope&& other) noexcept {
435435
Chain = std::move(other.Chain);
436436
Size = std::exchange(other.Size, 0);
437437
InvalidateIterators();

ydb/library/actors/util/rope_cont_embedded_list.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class TChunkList {
214214
*this = other;
215215
}
216216

217-
TChunkList(TChunkList&& other) {
217+
TChunkList(TChunkList&& other) noexcept {
218218
*this = std::move(other);
219219
}
220220

@@ -228,7 +228,7 @@ class TChunkList {
228228
return *this;
229229
}
230230

231-
TChunkList& operator=(TChunkList&& other) {
231+
TChunkList& operator=(TChunkList&& other) noexcept {
232232
if (this != &other) {
233233
Erase(begin(), end());
234234
Y_DEBUG_ABORT_UNLESS(!*this);

0 commit comments

Comments
 (0)