mirror of https://github.com/fluffle/goirc
Remove extraneous use of append in serialDispatch.
This commit is contained in:
parent
a271cc06f3
commit
cdd08b2de8
|
@ -143,9 +143,9 @@ func (r *registry) serialDispatch(name string, ev ...interface{}) {
|
||||||
r.RLock()
|
r.RLock()
|
||||||
defer r.RUnlock()
|
defer r.RUnlock()
|
||||||
if l, ok := r.events[name]; ok {
|
if l, ok := r.events[name]; ok {
|
||||||
hlist := make([]Handler, 0, l.Len())
|
hlist := make([]Handler, l.Len())
|
||||||
for e := l.Front(); e != nil; e = e.Next() {
|
for e, i := l.Front(), 0; e != nil; e, i = e.Next(), i+1 {
|
||||||
hlist = append(hlist, e.Value.(Handler))
|
hlist[i] = e.Value.(Handler)
|
||||||
}
|
}
|
||||||
go func() {
|
go func() {
|
||||||
for _, h := range hlist {
|
for _, h := range hlist {
|
||||||
|
|
Loading…
Reference in New Issue