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