From db1e44f543a0a5dadf1517537d543396620a858b Mon Sep 17 00:00:00 2001 From: Abdoulbari Zakir Date: Tue, 17 Dec 2024 14:44:16 +0100 Subject: [PATCH] upd --- .../study/parts/short-term-storage/container.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/libs/antares/study/parts/short-term-storage/container.cpp b/src/libs/antares/study/parts/short-term-storage/container.cpp index 609b55e1b5..5eb2971359 100644 --- a/src/libs/antares/study/parts/short-term-storage/container.cpp +++ b/src/libs/antares/study/parts/short-term-storage/container.cpp @@ -22,6 +22,7 @@ #include "antares/study/parts/short-term-storage/container.h" #include +#include #include #include @@ -194,12 +195,13 @@ bool STStorageInput::saveDataSeriesToFolder(const std::string& folder) const std::size_t STStorageInput::cumulativeConstraintCount() const { - size_t result = 0; - for (const auto& cluster: storagesByIndex) - { - result += cluster.additional_constraints.size(); - } - return result; + return std::accumulate(storagesByIndex.begin(), + storagesByIndex.end(), + 0., + [](double acc, const auto& cluster) + { + return cluster.additional_constraints.size(); + }); } std::size_t STStorageInput::count() const