Simplify code in a few places

Found by running `gosimple ./...`
This commit is contained in:
Lucas Clemente 2017-04-05 22:03:25 +01:00
parent b26d9f92b8
commit 013d7fdb30
13 changed files with 22 additions and 49 deletions

View file

@ -213,10 +213,7 @@ func (m *streamsMap) Iterate(fn streamLambda) error {
m.mutex.Lock()
defer m.mutex.Unlock()
openStreams := make([]protocol.StreamID, len(m.openStreams), len(m.openStreams))
for i, streamID := range m.openStreams { // copy openStreams
openStreams[i] = streamID
}
openStreams := append([]protocol.StreamID{}, m.openStreams...)
for _, streamID := range openStreams {
cont, err := m.iterateFunc(streamID, fn)