mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-07 08:36:02 -10:00
menu_cbs_sublabel: convert the uniform dispatch cases to a searched table
Eight hundred five groups of the thousand-case sublabel switch - 826 labels, each case a bind and a break - become one const table of label and callback rows, platform guards carried inside; the 232 cases with surrounding guard scope or extra logic stay in the residual switch, and groups whose guards span group boundaries were left literal rather than lose their scope. Lookup is a linear scan of the const table, keeping every row in read-only, link-resolved storage on non-PIE targets rather than paying a runtime sort with dirty pages. Verified by a transient in-binary referee holding the original switch: all 6,403 enums bind identical pointers through the new path, zero mismatches, run against this exact form. The file drops 1,565 lines - 6,073 to 4,508 - and the object 18.5 kilobytes, 12.4 of text and a net 6 of data, the switch's jump tables having cost more than the table that replaced them.
This commit is contained in:
1 parent
c46ce8c13f
commit
f5c0413682
1 file changed
+857
-2438
+857
-2438
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user