perf: hand out the cached dataset on an empty search
Merged
FU
16d ago+53+53+01234567890123456789-33-33-01234567890123456789
clearing a search reuses the sorted order already worked out instead of rechecking every row
Summary by cubic
Clearing a search now reuses the cached dataset instead of recopying every row, so the sort cache can skip its subset walk on an empty term.
getCitiesandgetFilmsnow return the frozen cached array for the empty search term instead of a copy.loadEnvelopefreezes the cached array, since callers now share it and a mutation would reorder every later caller's rows.- Public result types are now
readonlyto reflect that callers don't own a mutable array.