From 7a982e3c49c4fc16c2d51bf6e892cb2dd19405be Mon Sep 17 00:00:00 2001 From: ALTree Date: Sat, 11 Jul 2015 16:30:24 +0200 Subject: [PATCH] [dev.ssa] cmd/compile/ssa: Replace less-or-equal with equal in len comparison with zero Since the spec guarantees than 0 <= len always: https://golang.org/ref/spec#Length_and_capacity replace len(...) <= 0 check with len(...) == 0 check Change-Id: I5517a9cb6b190f0b1ee314a67487477435f3b409 Reviewed-on: https://go-review.googlesource.com/12034 Reviewed-by: Brad Fitzpatrick --- src/cmd/compile/internal/ssa/func.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/ssa/func.go b/src/cmd/compile/internal/ssa/func.go index bd2b74c151..34d2780104 100644 --- a/src/cmd/compile/internal/ssa/func.go +++ b/src/cmd/compile/internal/ssa/func.go @@ -48,7 +48,7 @@ func (bp *blockPool) newBlock() *Block { bp.mu.Lock() defer bp.mu.Unlock() - if len(bp.blocks) <= 0 { + if len(bp.blocks) == 0 { bp.blocks = make([]Block, blockSize, blockSize) } -- 2.48.1