Commit 1321ac7
committed
fix(resolve): algorithmic and readability improvements
- Replace O(cmds x exts) find_command_protect linear scan with a
prebaked HashMap built in a single pass over extensions.
- Replace O(n) string-comparison .find() in build_feature_pfn_ranges
with a direct zip, since both slices are built in matching order.
- Make the --predecessors fixed-point loop incremental: maintain
command/enum sets across iterations, only extending from newly
added extensions rather than rebuilding from scratch each pass.
- Remove duplicated work in topo_sort_typedefs cycle fallback that
built in-degree/reverse-dep structures without deduplication, then
immediately discarded and rebuilt them with deduplication.
- Introduce a Protection enum to replace the Option<Vec<String>>
convention (None = unconditional, Some = guarded) used across
build_ext_type_protections, record_protect, and
infer_include_protections. Centralizes the lattice merge logic
in add_extension() and eliminates ~40 lines of duplicated
match/if-let chains.
- Deduplicate the GL auto-exclude set ("stddef", "khrplatform",
"inttypes") into a module-level constant shared by
build_type_list and collect_required_headers.
- Clean up fully-qualified std::collections paths; add VecDeque
to the import list.
Signed-off-by: Steven Noonan <steven@uplinklabs.net>1 parent ae6bee4 commit 1321ac7
1 file changed
Lines changed: 228 additions & 220 deletions
0 commit comments