diff --git a/src/libs/antares/study/area/list.cpp b/src/libs/antares/study/area/list.cpp index 7af3a6a5a7..868c3d5490 100644 --- a/src/libs/antares/study/area/list.cpp +++ b/src/libs/antares/study/area/list.cpp @@ -1194,12 +1194,14 @@ bool AreaList::loadFromFolder(const StudyLoadOptions& options) if (fs::exists(stsFolder)) { - for (const auto& [id, area]: areas) + for (const auto& area: areas | std::views::values) { - fs::path folder = stsFolder / "clusters" / area->id.c_str(); + fs::path cluster_folder = stsFolder / "clusters" / area->id.c_str(); + ret = area->shortTermStorage.createSTStorageClustersFromIniFile(cluster_folder) && + ret; - ret = area->shortTermStorage.createSTStorageClustersFromIniFile(folder) && ret; - ret = area->shortTermStorage.LoadConstraintsFromIniFile(folder) && ret; + const auto constraints_folder = stsFolder / "constraints" / area->id.c_str(); + ret = area->shortTermStorage.LoadConstraintsFromIniFile(cluster_folder) && ret; } } else 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 5dee3106dc..1e46be0a5f 100644 --- a/src/libs/antares/study/parts/short-term-storage/container.cpp +++ b/src/libs/antares/study/parts/short-term-storage/container.cpp @@ -163,12 +163,11 @@ bool STStorageInput::LoadConstraintsFromIniFile(const fs::path& parent_path) return false; } - auto it = std::find_if(storagesByIndex.begin(), - storagesByIndex.end(), - [&additional_constraints](const STStorageCluster& cluster) - { - return cluster.id == additional_constraints.cluster_id; - }); + auto it = std::ranges::find_if(storagesByIndex, + [&additional_constraints](const STStorageCluster& cluster) + { + return cluster.id == additional_constraints.cluster_id; + }); if (it == storagesByIndex.end()) { logs.warning() << " from file " << pathIni;