Skip to content

Commit

Permalink
issue-2725: refactor file and fix responce
Browse files Browse the repository at this point in the history
  • Loading branch information
vladstepanyuk committed Jan 16, 2025
1 parent fbeefeb commit 010bdce
Showing 1 changed file with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ using namespace NKikimr::NTabletFlatExecutor;

namespace {


TVector<NProto::TDeviceConfig> ExtractDevicesFromDiskInfo(TDiskInfo &diskInfo) {
TVector<NProto::TDeviceConfig> ExtractDevicesFromDiskInfo(TDiskInfo& diskInfo)
{
TVector devices = std::move(diskInfo.Devices);

auto devicesToAdd = diskInfo.Migrations.size();
for (const auto& replica: diskInfo.Replicas) {
devicesToAdd += replica.size();
}

devices.reserve(devices.size() + devicesToAdd);
devices.reserve(
devices.size() * (diskInfo.Replicas.size() + 1) +
diskInfo.Migrations.size());

for (auto& migration: diskInfo.Migrations) {
devices.emplace_back(std::move(*migration.MutableTargetDevice()));
Expand All @@ -39,8 +35,7 @@ TVector<NProto::TDeviceConfig> ExtractDevicesFromDiskInfo(TDiskInfo &diskInfo) {
return devices;
}

} // namespace

} // namespace

////////////////////////////////////////////////////////////////////////////////

Expand All @@ -53,7 +48,7 @@ void TDiskRegistryActor::HandleAcquireDisk(
auto replyWithError = [&](auto error)
{
auto response =
std::make_unique<TEvDiskRegistry::TEvReleaseDiskResponse>(
std::make_unique<TEvDiskRegistry::TEvAcquireDiskResponse>(
std::move(error));
NCloud::Reply(ctx, *ev, std::move(response));
};
Expand Down

0 comments on commit 010bdce

Please sign in to comment.