From ab9b70d7e84bf6b7f3bb5d23733a89242fdcf195 Mon Sep 17 00:00:00 2001 From: Seebs Date: Wed, 11 Aug 2021 15:22:54 -0500 Subject: [PATCH] mapperLocal: actually leave loop on read from done channel staticcheck points out that the break is otherwise an ineffective break because it just ends the current case clause of the switch it's in, which is true. --- executor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/executor.go b/executor.go index ec071f34f..8cd24f33e 100644 --- a/executor.go +++ b/executor.go @@ -5939,6 +5939,7 @@ func (e *executor) mapperLocal(ctx context.Context, shards []uint64, mapFn mapFu ch := make(chan mapResponse, len(shards)) expected := 0 + shardLoop: for _, shard := range shards { j := job{ shard: shard, @@ -5949,7 +5950,7 @@ func (e *executor) mapperLocal(ctx context.Context, shards []uint64, mapFn mapFu } select { case <-done: - break + break shardLoop case e.work <- j: expected++ }