Skip to content

Commit 7b37186

Browse files
committed
replace len(x)<=v with len(x)==v
Length can't be negative, so use more appropriate operator. Found using https://go-critic.github.io/overview#sloppyLen-ref
1 parent 990c305 commit 7b37186

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

language/parser/parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@ func reverse(parser *Parser, openKind int, parseFn parseFn, closeKind int, zinte
16001600
}
16011601
nodes = append(nodes, node)
16021602
}
1603-
if zinteger && len(nodes) <= 0 {
1603+
if zinteger && len(nodes) == 0 {
16041604
return nodes, unexpectedEmpty(parser, token.Start, openKind, closeKind)
16051605
}
16061606
return nodes, nil

0 commit comments

Comments
 (0)