2 Commits

Author SHA1 Message Date
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
Brad Fitzpatrick
dca4036a20 util/set: add SmallSet
Updates tailscale/corp#29093

Change-Id: I0e07e83dee51b4915597a913b0583c99756d90e2
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-29 11:59:35 -07:00