]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.ssa] cmd/compile/ssa: Replace less-or-equal with equal in len comparison with...
authorALTree <alb.donizetti@gmail.com>
Sat, 11 Jul 2015 14:30:24 +0000 (16:30 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 11 Jul 2015 19:38:57 +0000 (19:38 +0000)
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>
src/cmd/compile/internal/ssa/func.go

index bd2b74c1511eb685dd2a6ec0178cad47329285c9..34d27801046df396cdeaa8e843d3e924fa17f662 100644 (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)
        }