@@ -12,6 +12,7 @@ namespace edm {
1212 template <typename Iter>
1313 Iter foundLaterIn (Iter itBegin, Iter it, Iter itEnd, std::string const & name) {
1414 auto itFind = std::find (itBegin, itEnd, name);
15+ // Sanity check, it should be impossible for this to happen
1516 if (itFind < it) {
1617 throwIncompatibleOrdering (" process " + name + " found earlier in other list" );
1718 }
@@ -55,28 +56,17 @@ namespace edm {
5556 auto itFindNew = foundLaterIn (iHistory.begin (), itNew, itNewEnd, *itOld);
5657 if (itFindOld != itOldEnd) {
5758 if (itFindNew != itNewEnd) {
58- throwIncompatibleOrdering (" process " + *itNew + " and " + *itOld + " are out of order" );
59- }
60- // found it, copy over everything up to and including it
61- while (itOld != itFindOld) {
62- tempNames.push_back (*itOld);
63- ++itOld;
59+ throwIncompatibleOrdering (" order of processes " + *itNew + " and " + *itOld +
60+ " is not the same in all ProcessHistories" );
6461 }
6562 tempNames.push_back (*itOld);
6663 ++itOld;
67- ++itNew;
6864 } else {
6965 if (itFindNew == itNewEnd) {
70- throwIncompatibleOrdering (" process " + *itOld + " and " + *itNew + " are independent " );
66+ throwIncompatibleOrdering (" order of processes " + *itOld + " and " + *itNew + " is ambiguous " );
7167 }
72- while (itNew != itFindNew) {
73- tempNames.push_back (*itNew);
74- ++itNew;
75- }
76- // not found, add the new one
7768 tempNames.push_back (*itNew);
7869 ++itNew;
79- ++itOld;
8070 }
8171 }
8272 }
0 commit comments