mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-04 10:50:54 +01:00
This is hot loop.
This commit is contained in:
parent
5eccbbf15e
commit
f8be9c62fb
1 changed files with 6 additions and 3 deletions
|
@ -145,8 +145,11 @@ private:
|
|||
}
|
||||
|
||||
eclass.parents.clear();
|
||||
for (auto& [enode, id] : map)
|
||||
eclass.parents.push_back({std::move(enode), id});
|
||||
for (auto it = map.begin(); it != map.end();)
|
||||
{
|
||||
auto node = map.extract(it++);
|
||||
eclass.parents.emplace_back(std::move(node.key()), node.mapped());
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -186,7 +189,7 @@ public:
|
|||
unionfind.merge(id1, id2);
|
||||
|
||||
EClass<L, typename N::Data>& eclass1 = get(id1);
|
||||
EClass<L, typename N::Data> eclass2 = get(id2);
|
||||
EClass<L, typename N::Data> eclass2 = std::move(get(id2));
|
||||
classes.erase(id2);
|
||||
|
||||
worklist.reserve(worklist.size() + eclass2.parents.size());
|
||||
|
|
Loading…
Add table
Reference in a new issue