We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
there is a function in server.go:
server.go
func pathMatch(pattern, path string) bool { if len(pattern) == 0 { // should not happen return false } n := len(pattern) if pattern[n-1] != '/' { return pattern == path } return len(path) >= n && path[0:n] == pattern }
if assign len(pattern) to variable n at the first line and do check if n == 0 then number of calls len() will be reduced.
if n == 0
The text was updated successfully, but these errors were encountered:
len() is not a call. It's as cheap as accessing a variable. Both "calls" will likely just be the same register access.
len()
Sorry, something went wrong.
No branches or pull requests
there is a function in
server.go
:if assign len(pattern) to variable n at the first line and do check
if n == 0
then number of calls len() will be reduced.The text was updated successfully, but these errors were encountered: