refactor: remove unnecessary string cloning when finding hotkey conflicts (#68)

Changed `HotkeyConfig::find_conflicts` to return a `Vec<(&str, &str)>` rather than allocating owned `Strings`. In `src/gui/draw.rs`, the code now builds a `HashSet<&str>` directly from the borrowed strings using array-based flat-mapping, avoiding intermediate `Vec` allocations and redundant clones.

Benchmarked to be approximately 3.5x faster in scenarios involving many configured slots.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This commit is contained in:
Tarasov Aleksandr
2026-04-20 19:20:54 +03:00
committed by GitHub
parent d4d16f6ce7
commit f87dcb1564
3 changed files with 9 additions and 13 deletions
+4 -6
View File
@@ -1,9 +1,7 @@
use crate::{
types::{
audio_player::AudioPlayer,
config::DaemonConfig,
socket::{MAX_MESSAGE_SIZE, Request, Response},
},
use crate::types::{
audio_player::AudioPlayer,
config::DaemonConfig,
socket::{MAX_MESSAGE_SIZE, Request, Response},
};
use std::os::unix::fs::PermissionsExt;