tailscale/util/set
Brad Fitzpatrick ef49e75b10 util/set: add SmallSet.SoleElement, fix bug, add more tests
This adds SmallSet.SoleElement, which I need in another repo for
efficiency. I added tests, but those tests failed because Add(1) +
Add(1) was promoting the first Add's sole element to a map of one
item. So fix that, and add more tests.

Updates tailscale/corp#29093

Change-Id: Iadd5ad08afe39721ee5449343095e389214d8389
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-29 13:06:29 -07:00
..
handle.go util/set: add some useful utility functions for Set (#9535) 2023-09-29 14:31:02 -07:00
set_test.go util/set: add Of variant of SetOf that takes variadic parameter 2024-05-05 21:14:28 -07:00
set.go util/set: add Of variant of SetOf that takes variadic parameter 2024-05-05 21:14:28 -07:00
slice_test.go util/set: move Slice type from corp to oss 2023-04-14 19:25:39 -04:00
slice.go all: use iterators over slice views more 2024-11-11 13:22:34 -08:00
smallset_test.go util/set: add SmallSet.SoleElement, fix bug, add more tests 2025-05-29 13:06:29 -07:00
smallset.go util/set: add SmallSet.SoleElement, fix bug, add more tests 2025-05-29 13:06:29 -07:00