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

perf(params): use NewReplacer to replace params #1148

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

WaterLemons2k
Copy link
Contributor

What does this PR do?

Changed all ReplaceAll() to NewReplacer() to improve performance when replacing parameters.

Motivation

Compared to ReplaceAll(), NewReplacer() is probably a better choice, because you only need to maintain a list of old and new string pairs.

Additional Notes

Use a map to build parameters in callback to improve readability.

Also fixed this value of err is never used (SA4006) in NameSilo.listRecords by error handling.


Compared to `ReplaceAll()`, `NewReplacer()` is probably a better choice,
because you only need to maintain a list of old and new string pairs.
@jeessy2 jeessy2 merged commit 7466211 into jeessy2:master Jun 7, 2024
2 checks passed
@WaterLemons2k WaterLemons2k deleted the replacer branch June 7, 2024 03:03
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.

2 participants