libcosmic-yoda/src/widget/table
Lionel DARNIS 1d98eee6de perf(widget): avoid VecDeque clone in segmented_button/table Model::clear
Model::clear() cloned the entire order VecDeque to iterate while
remove() mutated it, producing an O(n) allocation proportional to the
number of items — needless on a clear() which is going to drop all of
them anyway.

Replace the clone with std::mem::take(&mut self.order): we iterate the
taken VecDeque (transferring ownership), and the inner self.order.remove(index)
in each remove() call now finds position()==None and no-ops, since
self.order has been swapped with an empty default.

Same semantics, zero allocation. Noticeable on large nav/table models
(>100 items) and on apps that reset state frequently (settings pages,
file lists, context menus).
2026-04-19 16:29:02 +02:00
..
model perf(widget): avoid VecDeque clone in segmented_button/table Model::clear 2026-04-19 16:29:02 +02:00
widget chore: re-export iced row and column 2026-04-03 20:39:31 +02:00
mod.rs feat: menu bar popups 2025-06-10 18:22:07 +02:00