From cdd08b2de8ef612a0421c86f5b0d15cc5906bdff Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Wed, 9 Nov 2011 20:30:37 +0000 Subject: [PATCH] Remove extraneous use of append in serialDispatch. --- event/registry.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/event/registry.go b/event/registry.go index 379aed3..920c3f8 100644 --- a/event/registry.go +++ b/event/registry.go @@ -143,9 +143,9 @@ func (r *registry) serialDispatch(name string, ev ...interface{}) { r.RLock() defer r.RUnlock() if l, ok := r.events[name]; ok { - hlist := make([]Handler, 0, l.Len()) - for e := l.Front(); e != nil; e = e.Next() { - hlist = append(hlist, e.Value.(Handler)) + hlist := make([]Handler, l.Len()) + for e, i := l.Front(), 0; e != nil; e, i = e.Next(), i+1 { + hlist[i] = e.Value.(Handler) } go func() { for _, h := range hlist {