File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
21
21
"errors"
22
22
"fmt"
23
23
"reflect"
24
+ "slices"
24
25
"sync"
25
26
"time"
26
27
)
@@ -66,7 +67,7 @@ func (mux *TypeMux) Subscribe(types ...interface{}) *TypeMuxSubscription {
66
67
for _ , t := range types {
67
68
rtyp := reflect .TypeOf (t )
68
69
oldsubs := mux .subm [rtyp ]
69
- if find (oldsubs , sub ) != - 1 {
70
+ if slices . Index (oldsubs , sub ) != - 1 {
70
71
panic (fmt .Sprintf ("event: duplicate type %s in Subscribe" , rtyp ))
71
72
}
72
73
subs := make ([]* TypeMuxSubscription , len (oldsubs )+ 1 )
@@ -118,7 +119,7 @@ func (mux *TypeMux) del(s *TypeMuxSubscription) {
118
119
mux .mutex .Lock ()
119
120
defer mux .mutex .Unlock ()
120
121
for typ , subs := range mux .subm {
121
- if pos := find (subs , s ); pos >= 0 {
122
+ if pos := slices . Index (subs , s ); pos >= 0 {
122
123
if len (subs ) == 1 {
123
124
delete (mux .subm , typ )
124
125
} else {
You can’t perform that action at this time.
0 commit comments