This is an archive of the discontinued LLVM Phabricator instance.

[VectorUtils] Use early_inc_range instead of DelSet (NFC).
ClosedPublic

Authored by fhahn on Apr 18 2020, 2:43 AM.

Details

Summary

DelSet was used to avoid invalidating the current iterator while
modifying the map we are iterating over.

By using an early_inc_range, (which increments to iterator 'early',
allowing us to remove the current element), we can get rid of DelSet.

Diff Detail

Event Timeline

fhahn created this revision.Apr 18 2020, 2:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 18 2020, 2:43 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Ayal accepted this revision.Apr 18 2020, 4:06 AM

Yes, that's indeed better, thanks!

(Maybe worth adding a comment that releaseGroup(Group) erases Group from InterleaveGroups, to explain the use of make_early_inc_range; if it's not obvious.)

This revision is now accepted and ready to land.Apr 18 2020, 4:06 AM
This revision was automatically updated to reflect the committed changes.