From: ALTree Date: Sat, 11 Jul 2015 14:30:24 +0000 (+0200) Subject: [dev.ssa] cmd/compile/ssa: Replace less-or-equal with equal in len comparison with... X-Git-Tag: go1.7beta1~1623^2^2~401 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7a982e3c49c4fc16c2d51bf6e892cb2dd19405be;p=gostls13.git [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 --- 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) }