perf(gui): remove O(N) allocation in hotkeys table render (#94)

This optimization removes an unnecessary `.cloned()` call inside `draw_hotkeys_table`
which previously forced a clone of every filtered `HotkeySlot` on every frame render.
Instead, we now hold a `Vec<&HotkeySlot>` and only clone `slot.slot` exactly when
a user interaction requires ownership to dispatch a `HotkeyAction`.

This eliminates constant heap allocations of `String` and `Request` components
while scrolling or idling in the hotkeys view.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This commit is contained in:
Tarasov Aleksandr
2026-05-01 01:48:43 +03:00
committed by GitHub
parent e6c8d720d5
commit b2f2894aa1
-1
View File
@@ -231,7 +231,6 @@ impl SoundpadGui {
.to_lowercase()
.contains(&search)
})
.cloned()
.collect();
let available_width = ui.available_width();