util/eventbus: remove redundant code from eventbus.Publish

eventbus.Publish() calls newPublisher(), which in turn invokes (*Client).addPublisher().
That method adds the new publisher to c.pub, so we don’t need to add it again in eventbus.Publish.

Updates #cleanup

Signed-off-by: Nick Khyl <nickk@tailscale.com>
This commit is contained in:
Nick Khyl
2025-06-13 18:08:22 -05:00
committed by Nick Khyl
parent 5b7cf7fc36
commit 866614202c
3 changed files with 13 additions and 20 deletions
+1 -5
View File
@@ -21,11 +21,7 @@ type Publisher[T any] struct {
}
func newPublisher[T any](c *Client) *Publisher[T] {
ret := &Publisher[T]{
client: c,
}
c.addPublisher(ret)
return ret
return &Publisher[T]{client: c}
}
// Close closes the publisher.