1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +00:00

LibJS: Avoid unnecessary copies in PlaceBlocks codegen pass

This commit is contained in:
Ben Wiederhake 2021-12-24 21:38:33 +01:00 committed by Andreas Kling
parent 8b8cd18482
commit a1aea5b9e0

View file

@ -26,7 +26,11 @@ void PlaceBlocks::perform(PassPipelineExecutable& executable)
reachable_blocks.set(block);
replaced_blocks.append(*const_cast<BasicBlock*>(block));
for (auto& entry : cfg.get(block).value_or({}))
auto children = cfg.find(block);
if (children == cfg.end())
return;
for (auto& entry : children->value)
visit(entry);
};