Files
teleport/lib/expression
Trent Clarke 92397c10f2 Adds Generic Set type to utils (#47314)
* Adds Generic Set type to `utils`

This patch adds a generic set type to the `utils` package, providing
utility methods and a friendlier syntax for the common Go pattern of
modelling a set of `T` as a `map[T]struct{}`.

While having a common implemntation of set operations like `intersection`
is useful, the main motivation for this change is readability. For example,
declaring a `Set[T]` signals the intent of the author much more clearly
than declaring a `map[T]struct{}`.

* Replace Set.AddAll() with variadic Set.Add()

* Made Remove variadic to match Add()

* Removed obsolete test, added test for Remove()

* Rewrites expression.Set in terms of utils.Set[T] (#47375)

Refactors the Set type in the `expression` package to use `utils.Set[T]` as
the underlying implementations. The `expression.Set` type still exists in
order to implement `expression`-specific interfaces.
2024-10-09 23:34:00 +00:00
..
2024-10-09 23:34:00 +00:00