mirror of
https://github.com/luau-lang/luau.git
synced 2024-12-13 21:40:43 +00:00
23 lines
424 B
C
23 lines
424 B
C
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
||
|
#pragma once
|
||
|
|
||
|
#include "Luau/Id.h"
|
||
|
|
||
|
#include <vector>
|
||
|
|
||
|
namespace Luau::EqSat
|
||
|
{
|
||
|
|
||
|
/// See <https://dl.acm.org/doi/pdf/10.1145/321879.321884>.
|
||
|
struct UnionFind final
|
||
|
{
|
||
|
Id makeSet();
|
||
|
Id find(Id id) const;
|
||
|
void merge(Id a, Id b);
|
||
|
|
||
|
private:
|
||
|
std::vector<Id> parents;
|
||
|
};
|
||
|
|
||
|
} // namespace Luau::EqSat
|