Skip to content

Commit 9aea114

Browse files
committed
fix QF1006: could lift into loop condition (staticcheck)
Error: changes_linux.go:136:3: QF1006: could lift into loop condition (staticcheck) if ix1 >= len(names1) { ^ Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent a92b1f9 commit 9aea114

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

Diff for: changes_linux.go

+1-8
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,7 @@ func (w *walker) walk(path string, i1, i2 os.FileInfo) (err error) {
132132
ix1 := 0
133133
ix2 := 0
134134

135-
for {
136-
if ix1 >= len(names1) {
137-
break
138-
}
139-
if ix2 >= len(names2) {
140-
break
141-
}
142-
135+
for ix1 < len(names1) && ix2 < len(names2) {
143136
ni1 := names1[ix1]
144137
ni2 := names2[ix2]
145138

0 commit comments

Comments
 (0)