Withdraw the Moves::clear item from the thirteenth sweep

Bryan asked what that arena was and whether keeping its capacity had a
point. It does not: Moves::clear runs only when the root changes, beside a
rebuild of the whole tree, where RequestArena::reset runs every frame and
the allocation rig checks it. Arena also holds an IdTracker a clear has to
reset. The parallel was drawn on the shape of the code rather than on how
often it runs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
iris-aiandClaude Opus 5 committed 2026-09-20 22:47:15 -04:00
1 parent e397680a19
commit ea66fc3f71
2 files changed
+13 -7

No files matched your search

+9 -4
View File
@@ -63,7 +63,7 @@ all sixteen cases agree warm against cold with every bound a fraction
corpus and growing fractions here would move every box in the cold dump for
overlap; the comment now says that rather than describing an open defect.
Five things the sweep **looked at and left**:
Four things the sweep **looked at and left**, and one it withdrew:
- **`independent_order` compares two lengths by `leftover` where their pixels
and fractions are equal**, which is only sound while a leftover resolves at
@@ -82,9 +82,14 @@ Five things the sweep **looked at and left**:
preferred length, the mirror of the defect fixed above. Left because
nothing asks for it yet and the preferred length has no remover either; the
asymmetry is uniform.
- **`Moves::clear` replaces its arena rather than clearing it**, throwing away
capacity where `RequestArena::reset` deliberately keeps it. Left: it runs
only on a full redraw, and `Arena` has no `clear`.
- **`Moves::clear` replaces its arena rather than clearing it.** Raised as
the shape `RequestArena::reset` deliberately avoids, and withdrawn: that
one keeps its capacity because it runs every frame and the allocation rig
checks the steady state allocates nothing, where `Moves::clear` runs only
when the root changes, next to a rebuild of the whole tree that re-grows it
anyway. `Arena` also holds an `IdTracker` that a clear has to reset, which
`Arena::default()` says in one line. Frequency is what separates the two,
and the code looks the same either way.
- **`TextEditCtx::apply_event` reads `if undo && let Some(..)` with an `else
if` after it**, so an undo with an empty history now falls into the branch
that pushes history. It is equivalent only because an undo command does not