Windows wildcard expansion checks each candidate with mch_getperm() or mch_lstat(), then calls addfile(), which repeats the same existence check. Let addfile() perform the check once, clearing EW_NOTFOUND so nonexistent literal suffixes are still rejected.
Add coverage for existing and missing literal suffixes after wildcards, including recursive patterns and expand(). This change is independent of the earlier Windows stat optimization in #21446.
Local Windows benchmarks, with the earlier stat optimization applied to both binaries, showed 22-35% shorter wildcard searches across three patterns (30 repetitions each, unchanged match counts). Five paired startup runs gave medians of 356 ms before and 349 ms after; the overall startup benefit is modest.
Validation: rebuilt this isolated commit with MinGW-w64, with no new warnings. All applicable Test_glob tests passed (5 passed, 1 Unix-only skip). test_expand.vim had 7 passes and 1 Unix-only skip with Test_source_sfile excluded: that test failed with E484 for Xresult on both pre-change and modified binaries in an earlier run. git diff --check passed.
https://github.com/vim/vim/pull/21447
(2 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()