util/set: add some useful utility functions for Set (#9535)
Also give each type of set its own file. Updates #cleanup Signed-off-by: Chris Palmer <cpalmer@tailscale.com>
This commit is contained in:
+1
-1
@@ -15,7 +15,7 @@ type Slice[T comparable] struct {
|
||||
set map[T]bool // nil until/unless slice is large enough
|
||||
}
|
||||
|
||||
// Slice returns the a view of the underlying slice.
|
||||
// Slice returns a view of the underlying slice.
|
||||
// The elements are in order of insertion.
|
||||
// The returned value is only valid until ss is modified again.
|
||||
func (ss *Slice[T]) Slice() views.Slice[T] { return views.SliceOf(ss.slice) }
|
||||
|
||||
Reference in New Issue
Block a user