mirror of
https://github.com/arabianq/pipewire-soundpad.git
synced 2026-06-19 12:13:32 +00:00
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:
committed by
GitHub
parent
e6c8d720d5
commit
b2f2894aa1
@@ -231,7 +231,6 @@ impl SoundpadGui {
|
||||
.to_lowercase()
|
||||
.contains(&search)
|
||||
})
|
||||
.cloned()
|
||||
.collect();
|
||||
|
||||
let available_width = ui.available_width();
|
||||
|
||||
Reference in New Issue
Block a user