Skip to content

Commit

Permalink
issue-1394: TryUpdateDevices refactoring (#1578)
Browse files Browse the repository at this point in the history
Issue #1394

Previous pull request #1476 was merged without addressing several comments:

1. Rename agentsMap to agentsSet
2. use GetAgentId() instead of agentid()
  • Loading branch information
antonmyagkov committed Jul 22, 2024
1 parent 6574310 commit ff0fd65
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3650,18 +3650,18 @@ TVector<TDiskRegistryState::TDeviceId> TDiskRegistryState::TryUpdateDevices(
TVector<TDeviceId> ret;
ret.reserve(uuids.size());

TSet<TAgentId> agentsMap;
TSet<TAgentId> agentsSet;
for (const auto& uuid: uuids) {
auto [agent, device] = FindDeviceLocation(uuid);
if (!agent || !device) {
continue;
}
ret.push_back(uuid);
agentsMap.emplace(agent->agentid());
agentsSet.emplace(agent->GetAgentId());
AdjustDeviceIfNeeded(*device, now);
}

for (const auto& agentId: agentsMap) {
for (const auto& agentId: agentsSet) {
auto* agent = AgentList.FindAgent(agentId);
if (!agent) {
continue;
Expand Down

0 comments on commit ff0fd65

Please sign in to comment.