Remove extraneous use of append in serialDispatch.

This commit is contained in:
Alex Bramley 2011-11-09 20:30:37 +00:00
parent a271cc06f3
commit cdd08b2de8
1 changed files with 3 additions and 3 deletions

View File

@ -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 {