@@ -13,6 +13,7 @@ namespace edm {
1313 template <typename Iter>
1414 Iter foundLaterIn (Iter itBegin, Iter it, Iter itEnd, std::string const & name) {
1515 auto itFind = std::find (itBegin, itEnd, name);
16+ // Sanity check, it should be impossible for this to happen
1617 if (itFind < it) {
1718 throwIncompatibleOrdering (" process " + name + " found earlier in other list" );
1819 }
@@ -56,28 +57,17 @@ namespace edm {
5657 auto itFindNew = foundLaterIn (iHistory.begin (), itNew, itNewEnd, *itOld);
5758 if (itFindOld != itOldEnd) {
5859 if (itFindNew != itNewEnd) {
59- throwIncompatibleOrdering (" process " + *itNew + " and " + *itOld + " are out of order" );
60- }
61- // found it, copy over everything up to and including it
62- while (itOld != itFindOld) {
63- tempNames.push_back (*itOld);
64- ++itOld;
60+ throwIncompatibleOrdering (" order of processes " + *itNew + " and " + *itOld +
61+ " is not the same in all ProcessHistories" );
6562 }
6663 tempNames.push_back (*itOld);
6764 ++itOld;
68- ++itNew;
6965 } else {
7066 if (itFindNew == itNewEnd) {
71- throwIncompatibleOrdering (" process " + *itOld + " and " + *itNew + " are independent " );
67+ throwIncompatibleOrdering (" order of processes " + *itOld + " and " + *itNew + " is ambiguous " );
7268 }
73- while (itNew != itFindNew) {
74- tempNames.push_back (*itNew);
75- ++itNew;
76- }
77- // not found, add the new one
7869 tempNames.push_back (*itNew);
7970 ++itNew;
80- ++itOld;
8171 }
8272 }
8373 }
0 commit comments