Merge pull request #3632 from pmatos/RemoveBlocks

Use erase-remove idiom to remove element
This commit is contained in:
Ryan Houdek authored and GitHub committed 2024-05-16 10:50:50 -07:00
commit 3eb7a5b998
1 file changed
+2 -1
@@ -243,7 +243,8 @@ bool RAValidation::Run(IREmitter* IREmit) {
if (IsFowardsEdge(PredecessorID) && !HaveState) {
// We are probably about to visit this node anyway, remove it
std::remove(BlocksToVisit.begin(), BlocksToVisit.end(), Predecessor);
auto it = std::remove(BlocksToVisit.begin(), BlocksToVisit.end(), Predecessor);
BlocksToVisit.erase(it, BlocksToVisit.end());
// Add the missing predecessor to start of queue
BlocksToVisit.push_front(Predecessor);