Skip to content

collapse consecutive ** segments in glob translation - #155

Open
jmestwa-coder wants to merge 1 commit into
jaraco:mainfrom
jmestwa-coder:glob-collapse-recursive
Open

collapse consecutive ** segments in glob translation#155
jmestwa-coder wants to merge 1 commit into
jaraco:mainfrom
jmestwa-coder:glob-collapse-recursive

Conversation

@jmestwa-coder

Copy link
Copy Markdown

Noticed each ** segment becomes .* under (?s:) in translate_core, so a pattern with consecutive ** segments (**/**/**/...) emits adjacent .* separated by a slash. Matching one of those against a namelist entry of slashes backtracks catastrophically (around 8s at 15 segments, exponential in the count). Since **/** matches exactly what ** does, collapse runs of ** segments before translating so matching stays linear.

@jmestwa-coder

Copy link
Copy Markdown
Author

any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant