mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-02 01:51:59 +00:00
all: use set.Set consistently instead of map[T]struct{}
I didn't clean up the more idiomatic map[T]bool with true values, at
least yet. I just converted the relatively awkward struct{}-valued
maps.
Updates #cleanup
Change-Id: I758abebd2bb1f64bc7a9d0f25c32298f4679c14f
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
d506a55c8a
commit
dc7aa98b76
@@ -27,7 +27,7 @@ var (
|
||||
|
||||
sysErr = map[Subsystem]error{} // error key => err (or nil for no error)
|
||||
watchers = set.HandleSet[func(Subsystem, error)]{} // opt func to run if error state changes
|
||||
warnables = map[*Warnable]struct{}{} // set of warnables
|
||||
warnables = set.Set[*Warnable]{}
|
||||
timer *time.Timer
|
||||
|
||||
debugHandler = map[string]http.Handler{}
|
||||
@@ -84,7 +84,7 @@ func NewWarnable(opts ...WarnableOpt) *Warnable {
|
||||
}
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
warnables[w] = struct{}{}
|
||||
warnables.Add(w)
|
||||
return w
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user