-
-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove redundant
len
check (#2291)
`len` returns 0 if the slice or map is nil. From the Go specification [1]: "1. For a nil slice, the number of iterations is 0." "3. If the map is nil, the number of iterations is 0." Therefore, an additional `len(v) != 0` check for before the loop is unnecessary. [1]: https://go.dev/ref/spec#For_range Signed-off-by: Eng Zer Jun <[email protected]>
- Loading branch information
Showing
2 changed files
with
4 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters