Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Guard against no-op moves
  • Loading branch information
jbmorley committed Jan 28, 2026
commit 1202b7c3401d3aad98f4046f39bdf44c6967a756
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public class CollectionViewContainer<Element: Identifiable, Content: View, Deleg
guard let fromIndex = snapshot.indexOfItem(item.id) else {
fatalError("Attempted to move item not in list.")
}
if fromIndex == index || fromIndex + 1 == index { // TODO: Make this a guard.
guard fromIndex != index && fromIndex + 1 != index else {
return
}
guard fromIndex < snapshot.itemIdentifiers.count else {
Expand Down