Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate strings.Count in path matcher #6233

Closed
hlidotbe opened this issue Apr 10, 2024 · 1 comment
Closed

Duplicate strings.Count in path matcher #6233

hlidotbe opened this issue Apr 10, 2024 · 1 comment

Comments

@hlidotbe
Copy link
Contributor

Hi,

Unless I'm mistaken there's a redundant count in this check:

if strings.Count(matchPattern, "*") == 2 &&
strings.HasPrefix(matchPattern, "*") &&
strings.HasSuffix(matchPattern, "*") &&
strings.Count(matchPattern, "*") == 2 {

if it's indeed a mistake I'll do a PR ASAP.

@mholt
Copy link
Member

mholt commented Apr 10, 2024

Oh the second one is there in case the first one fails.

...

j/k. Would happily accept a PR. Thanks!

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

No branches or pull requests

2 participants