You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allowing matching without validation can save some cycles in the use cases where glob patterns have been already validated at an earlier point. A suggested (public) func may look like:
I've been having the same performance concerns for a while, also from a bazel gazelle extension where the same globs are invoked a significant number of times.
Sorry I haven't replied to this in so long - life is busy 😢
So, the validate flag to doMatchWithSeparator only affects one case: when matching reaches the end of name before reaching the end of pattern, ie, in something like Match("a/b/c", "a").
That's the only case Match runs validation. So, I wouldn't expect a huge performance improvement from a MatchUnvalidated. But, I suppose if matching is run many, many times, it would add up.
I cut a v4.7.0 which includes a MatchUnvalidated. It only returns a bool instead of bool, error.
doMatchWithSeparator
does support turning off validationdoublestar/match.go
Line 74 in 180028b
However, it's public counter part doesn't and always enables validation:
doublestar/match.go
Lines 52 to 53 in 180028b
Allowing matching without validation can save some cycles in the use cases where glob patterns have been already validated at an earlier point. A suggested (public) func may look like:
The text was updated successfully, but these errors were encountered: