Skip to content

Commit 5375d39

Browse files
authored
Remove redundant loop over published blocks (#950)
1 parent 9c0d23a commit 5375d39

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

bitswap/client/client.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,7 @@ func (bs *Client) receiveBlocksFrom(ctx context.Context, from peer.ID, blks []bl
498498
// Publish the block to any Bitswap clients that had requested blocks.
499499
// (the sessions use this pubsub mechanism to inform clients of incoming
500500
// blocks)
501-
for _, b := range wanted {
502-
bs.notif.Publish(from, b)
503-
}
501+
bs.notif.Publish(from, wanted...)
504502
}
505503

506504
// ReceiveMessage is called by the network interface when a new message is

0 commit comments

Comments
 (0)