1
0
mirror of https://github.com/golang/go synced 2024-10-05 18:31:28 -06:00

[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 <bradfitz@golang.org>
This commit is contained in:
ALTree 2015-07-11 16:30:24 +02:00 committed by Brad Fitzpatrick
parent 06f329220f
commit 7a982e3c49

View File

@ -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)
}