Skip to content

Conversation

@vosslab
Copy link

@vosslab vosslab commented Dec 5, 2025

Problem

The removeItem("spacer-tiles") branch iterates forward through the array while
removing items. This can cause skipped spacer entries and, depending on the set
of tiles, occasionally lead to an index mismatch error.

Fix

Iterate from the end of the list toward the beginning:

for i in stride(from: items.count - 1, through: 0, by: -1) { ... }

This preserves the original logic while ensuring safe removal of all spacer
tiles.

Testing

  • Built with swift build -c release on macOS 26.1
  • Added many spacers (spacer, small-spacer, flex-spacer)
  • Ran dockutil --remove spacer-tiles
  • Verified:
    • No crash
    • All spacers removed
    • Normal items unaffected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant