From 063af6f9e1f76287acf016613a6bdc9a7ee2c642 Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Fri, 8 Sep 2023 18:44:14 +0200 Subject: [PATCH] Replace loop --- cpp/controllers/abstract_controller.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cpp/controllers/abstract_controller.cpp b/cpp/controllers/abstract_controller.cpp index 1be7f848e2..bd005b4e3d 100644 --- a/cpp/controllers/abstract_controller.cpp +++ b/cpp/controllers/abstract_controller.cpp @@ -40,9 +40,7 @@ unordered_set> AbstractController::GetDevices() const { unordered_set> 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; }