mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-09 20:12:20 +00:00
CellStore::shift_rows, shift_cols, shift_cols_in_rows and take_range removed and re-set every affected cell one by one. They now take whole row maps (or the split-off part of one) out of the bands and put them back at their new position, so a row shift costs a few map operations per row instead of a band lookup, a remove and a set per cell. take_range does this when the block reaches the last column. Behaviour is unchanged, including blank cells left behind by get_mut, cells off the grid (they are still dropped, and still clear the cell they land on), cells shifted off the sheet, and copy-on-write: bands without moved cells stay shared with undo snapshots. A differential test runs 12,000 random operations against the old per-cell code and compares contents, length, iteration order and band sharing. shift_rows_in_cols, and take_range on a block with columns to its right, keep moving cell by cell: the row-map version measured no faster there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>