commit | 6f93b4df92b8fbf80529cb6435789f5a75664a20 | [log] [tgz] |
---|---|---|
author | Barney Gale <barney.gale@gmail.com> | Sat Feb 10 18:12:34 2024 +0000 |
committer | GitHub <noreply@github.com> | Sat Feb 10 18:12:34 2024 +0000 |
tree | 9847e44bb89c24c38f5217dada3fdfc83344a376 | |
parent | 9d1a353230f555fc28239c5ca1e82b758084e02a [diff] |
GH-115060: Speed up `pathlib.Path.glob()` by removing redundant regex matching (#115061) When expanding and filtering paths for a `**` wildcard segment, build an `re.Pattern` object from the subsequent pattern parts, rather than the entire pattern, and match against the `os.DirEntry` object prior to instantiating a path object. Also skip compiling a pattern when expanding a `*` wildcard segment.