From 9e1180a82e51e340d83626c3e486342c655f54b3 Mon Sep 17 00:00:00 2001 From: Ferenc Szabo Date: Thu, 17 Jan 2019 10:44:50 +0100 Subject: [PATCH] swarm/network: simplify some trivial statements --- swarm/network/stream/stream.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/swarm/network/stream/stream.go b/swarm/network/stream/stream.go index 67a04b992a..989fbaeb09 100644 --- a/swarm/network/stream/stream.go +++ b/swarm/network/stream/stream.go @@ -668,8 +668,7 @@ func peerStreamIntervalsKey(p *Peer, s Stream) string { func (c *client) AddInterval(start, end uint64) (err error) { i := &intervals.Intervals{} - err = c.intervalsStore.Get(c.intervalsKey, i) - if err != nil { + if err = c.intervalsStore.Get(c.intervalsKey, i); err != nil { return err } i.Add(start, end) @@ -733,11 +732,7 @@ func (c *client) batchDone(p *Peer, req *OfferedHashesMsg, hashes []byte) error } return nil } - // TODO: make a test case for testing if the interval is added when the batch is done - if err := c.AddInterval(req.From, req.To); err != nil { - return err - } - return nil + return c.AddInterval(req.From, req.To) } func (c *client) close() {