Skip to content

Commit baa411d

Browse files
committed
refactor: prefer for loop
1 parent 7e199f6 commit baa411d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ui/main-window/ThumbnailsView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ class ThumbnailsView: NSVisualEffectView {
222222
private func shiftRow(_ maxX: CGFloat, _ rowWidth: CGFloat, _ rowStartIndex: Int, _ index: Int) {
223223
let offset = ((maxX - rowWidth) / 2).rounded()
224224
if offset > 0 {
225-
(rowStartIndex..<index).forEach {
226-
ThumbnailsView.recycledViews[$0].frame.origin.x += App.shared.userInterfaceLayoutDirection == .leftToRight ? offset : -offset
225+
for i in rowStartIndex..<index {
226+
ThumbnailsView.recycledViews[i].frame.origin.x += App.shared.userInterfaceLayoutDirection == .leftToRight ? offset : -offset
227227
}
228228
}
229229
}

0 commit comments

Comments
 (0)