BWindow: Use a SplayTree to store shortcuts.

This makes for much faster lookups, and avoids the need
to allocate an array.

sizeof(BWindow) is unchanged (on x86_64, 504; on x86, 376)
so this should not break ABI/API.

Quick benchmark in Tracker:
501 lookups, before: ~488 usec
501 lookups, after: ~284 usec

Change-Id: Ica2c728f0c5957380add53e14a826a4aade52df0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10720
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Augustin Cavalier
2026-04-13 19:24:34 +00:00
committed by waddlesplash
parent fd2113c61a
commit ad37e9a395
2 changed files with 96 additions and 46 deletions
+3 -1
View File
@@ -381,7 +381,9 @@ private:
uint32 _unused1;
BMenuBar* fKeyMenuBar;
BButton* fDefaultButton;
BList fShortcuts;
void* fShortcuts;
void* _unused2;
int32 _unused3[5];
int32 fTopViewToken;
bool fUpdateRequested;
bool fOffscreen;