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

refine make built-in function allocates add len #362

Closed
mrbardia72 opened this issue Mar 18, 2024 · 2 comments
Closed

refine make built-in function allocates add len #362

mrbardia72 opened this issue Mar 18, 2024 · 2 comments

Comments

@mrbardia72
Copy link
Contributor

https://github.com/ardanlabs/service/blob/master/foundation/validate/errors.go#L39

m := make(map[string]string) ===> m := make(map[string]string,len(fe))

@ardan-bkennedy
Copy link
Contributor

You could do this but it won't make any difference in the performance of the app. This is a failure condition, not normal path. Even if it was normal path, I think it's insignificant. If this came up in a profile, then for sure this needs to be done.

All that being said, if you want to provide a PR, I'll accept it.

@ardan-bkennedy
Copy link
Contributor

Fixed by PR 363

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