From 793405d8e7e4d176e456d8d7392240a9c489db48 Mon Sep 17 00:00:00 2001 From: Piotr Konopka Date: Wed, 18 Oct 2023 09:02:05 +0200 Subject: [PATCH] Some ranges use in Check --- Framework/src/Check.cxx | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Framework/src/Check.cxx b/Framework/src/Check.cxx index 18b8471352..9b232deae1 100644 --- a/Framework/src/Check.cxx +++ b/Framework/src/Check.cxx @@ -13,10 +13,8 @@ #include #include -// boost -#include -#include #include +#include // O2 #include // QC @@ -122,12 +120,10 @@ QualityObjectsType Check::check(std::map 0; }) | + std::views::transform([&](const auto& key) { return std::pair{ key, moMap[key] }; }), + std::inserter(shadowMap, shadowMap.end())); } // Prepare a vector of MO maps to be checked, each one will receive a separate Quality. @@ -143,10 +139,7 @@ QualityObjectsType Check::check(std::map monitorObjectsNames; - boost::copy(moMapToCheck | boost::adaptors::map_keys, std::back_inserter(monitorObjectsNames)); - - if (std::any_of(moMapToCheck.begin(), moMapToCheck.end(), [](const std::pair>& item) { + if (std::ranges::any_of(moMapToCheck, [](const std::pair>& item) { return item.second == nullptr || item.second->getObject() == nullptr; })) { ILOG(Warning, Devel) << "Some MOs in the map to check are nullptr, skipping check '" << mCheckInterface->getName() << "'" << ENDM; @@ -167,6 +160,8 @@ QualityObjectsType Check::check(std::mapgetActivity(); })); ILOG(Debug, Devel) << "Check '" << mCheckConfig.name << "', quality '" << quality << "'" << ENDM; + std::vector monitorObjectsNames; + std::ranges::copy(moMapToCheck | std::views::keys, std::back_inserter(monitorObjectsNames)); // todo: take metadata from somewhere qualityObjects.emplace_back(std::make_shared( quality,