From 8fddfc4f105119d70fbf05ddc5022e82e6911f38 Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Thu, 5 Oct 2023 23:02:28 +0200 Subject: [PATCH] Cleanup --- cpp/scsictl/scsictl_display.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cpp/scsictl/scsictl_display.cpp b/cpp/scsictl/scsictl_display.cpp index a8e88f9da8..235fadca16 100644 --- a/cpp/scsictl/scsictl_display.cpp +++ b/cpp/scsictl/scsictl_display.cpp @@ -237,12 +237,8 @@ string ScsictlDisplay::DisplayStatisticsInfo(const PbStatisticsInfo& statistics_ s << "Statistics:\n"; - vector sorted_statistics; - for (const auto& statistics : statistics_info.statistics()) { - sorted_statistics.push_back(statistics); - } - // Sort by descending category and ascending key + vector sorted_statistics = { statistics_info.statistics().begin(), statistics_info.statistics().end() }; ranges::sort(sorted_statistics, [] (const PbStatistics& a, const PbStatistics& b) { return a.category() > b.category() || a.key() < b.key(); } );