Skip to content

Commit

Permalink
Replace loop
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Sep 8, 2023
1 parent ef4047d commit ab718eb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cpp/controllers/abstract_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ unordered_set<shared_ptr<PrimaryDevice>> AbstractController::GetDevices() const
{
unordered_set<shared_ptr<PrimaryDevice>> devices;

for (const auto& [id, lun] : luns) {
devices.insert(lun);
}
ranges::transform(luns, inserter(devices, devices.begin()), [] (const auto& entry) { return entry.second; } );

return devices;
}
Expand Down

0 comments on commit ab718eb

Please sign in to comment.