Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make TRope movable in case of vector growing #14329

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions ydb/core/blobstorage/vdisk/balance/sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ namespace {
[&](TRope&& data) {
// part is already in memory, no need to read it from disk
Y_DEBUG_ABORT_UNLESS(item.PartsMask.CountBits() == 1);
Result[i].PartsData.reserve(1);
Result[i].PartsData.emplace_back(std::move(data));
++Responses;
},
Expand Down Expand Up @@ -88,7 +87,7 @@ namespace {

for (ui8 partIdx = localParts.FirstPosition(); partIdx < localParts.GetSize(); partIdx = localParts.NextPosition(partIdx)) {
TRope result;
result = diskBlob.GetPart(partIdx, &result);
diskBlob.GetPart(partIdx, &result);
readSize += result.size();
Result[i].PartsData.emplace_back(std::move(result));
}
Expand Down
4 changes: 2 additions & 2 deletions ydb/library/actors/util/rope.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ class TRope {
Chain.PutToEnd(std::move(data));
}

TRope(TRope&& rope)
TRope(TRope&& rope) noexcept
: Chain(std::move(rope.Chain))
, Size(std::exchange(rope.Size, 0))
{
Expand Down Expand Up @@ -431,7 +431,7 @@ class TRope {
return *this;
}

TRope& operator=(TRope&& other) {
TRope& operator=(TRope&& other) noexcept {
Chain = std::move(other.Chain);
Size = std::exchange(other.Size, 0);
InvalidateIterators();
Expand Down
4 changes: 2 additions & 2 deletions ydb/library/actors/util/rope_cont_embedded_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class TChunkList {
*this = other;
}

TChunkList(TChunkList&& other) {
TChunkList(TChunkList&& other) noexcept {
*this = std::move(other);
}

Expand All @@ -228,7 +228,7 @@ class TChunkList {
return *this;
}

TChunkList& operator=(TChunkList&& other) {
TChunkList& operator=(TChunkList&& other) noexcept {
if (this != &other) {
Erase(begin(), end());
Y_DEBUG_ABORT_UNLESS(!*this);
Expand Down
Loading