Skip to content

Commit

Permalink
refactor: prefer for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
lwouis committed Dec 8, 2024
1 parent 7e199f6 commit baa411d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ui/main-window/ThumbnailsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ class ThumbnailsView: NSVisualEffectView {
private func shiftRow(_ maxX: CGFloat, _ rowWidth: CGFloat, _ rowStartIndex: Int, _ index: Int) {
let offset = ((maxX - rowWidth) / 2).rounded()
if offset > 0 {
(rowStartIndex..<index).forEach {
ThumbnailsView.recycledViews[$0].frame.origin.x += App.shared.userInterfaceLayoutDirection == .leftToRight ? offset : -offset
for i in rowStartIndex..<index {
ThumbnailsView.recycledViews[i].frame.origin.x += App.shared.userInterfaceLayoutDirection == .leftToRight ? offset : -offset
}
}
}
Expand Down

0 comments on commit baa411d

Please sign in to comment.