mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-07-28 08:56:13 +00:00
should_ignore_name runs once per directory entry during glob/grep tree walks and looped over ~57 IGNORE_PATTERNS calling fnmatch per pattern. Precompute the literal names into a frozenset (O(1)) and the few glob patterns into one combined compiled regex via fnmatch.translate; per name it's now one normcase + a set lookup + at most one regex match. os.path.normcase preserves fnmatch's platform case behavior, so results are identical (covered by an equivalence test against the old loop). Fixes #3655.