Fixed invalidated iterator bug pick up by Coverity.

This commit is contained in:
Robert Osfield
2016-06-10 12:44:26 +01:00
parent 69046511de
commit af11e35fcb

View File

@@ -456,7 +456,7 @@ struct LineConstructor
for(SegmentSet::iterator itr = _segments.begin();
itr != _segments.end();
++itr)
) // itr increment is done manually at end of loop
{
SegmentSet::iterator nextItr = itr;
++nextItr;
@@ -1056,6 +1056,9 @@ struct LineConstructor
classification = ((itr != _segments.end()) && (nextItr != _segments.end())) ? itr->compare(*nextItr) : Segment::UNCLASSIFIED;
}
// increment iterator it it's not already at end of container.
if (itr!=_segments.end()) ++itr;
}
}