From a76246f5a3aeb3e735a40d1b90575630fb7bb564 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Mon, 2 Aug 2021 11:59:37 +0200 Subject: [PATCH] [EDF23738] : bug correction to avoid regressions --- src/MEDLoader/MEDFileField.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/MEDLoader/MEDFileField.cxx b/src/MEDLoader/MEDFileField.cxx index 17b42cf44..df12e7be8 100644 --- a/src/MEDLoader/MEDFileField.cxx +++ b/src/MEDLoader/MEDFileField.cxx @@ -1092,7 +1092,12 @@ void MEDFileFields::aggregateFieldsOnSameMeshes(MEDFileMeshes *ms) { if(!ms) THROW_IK_EXCEPTION("MEDFileFields::aggregateFieldsOnSameMeshes : ms is nullptr !"); - MCAuto mfs(MEDFileFields::New()); + // + std::vector msNames(ms->getMeshesNames()); + std::set msNamesSet(msNames.begin(),msNames.end()); + if(msNames.size() == msNamesSet.size()) + return ; + // std::map> > fsByName; for(auto fmts : _fields) { @@ -1186,7 +1191,7 @@ void MEDFileFields::aggregateFieldsOnSameMeshes(MEDFileMeshes *ms) gg->setCoords(coo); otherMeshes.push_back(DynamicCast(gg)); } - // + // until this point nothing has changed in \a this nor in \a ms as if a const method. ms->resize(0); for(auto mesh : otherMeshes) ms->pushMesh(mesh); -- 2.39.2