0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-28 11:33:01 +01:00

Remove redundant nil check in WalkGitLog (#26773)

From the Go specification:

> "1. For a nil slice, the number of iterations is 0."
https://go.dev/ref/spec#For_range

Therefore, an additional nil check for before the loop is unnecessary.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun 2023-08-29 19:03:43 +08:00 committed by GitHub
parent db09b35590
commit ad3cbbc3b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -374,7 +374,6 @@ heaploop:
break heaploop break heaploop
} }
parentRemaining.Remove(current.CommitID) parentRemaining.Remove(current.CommitID)
if current.Paths != nil {
for i, found := range current.Paths { for i, found := range current.Paths {
if !found { if !found {
continue continue
@ -397,7 +396,6 @@ heaploop:
} }
} }
} }
}
if remaining <= 0 { if remaining <= 0 {
break heaploop break heaploop