chore: preallocate slices where we have a good idea of requirements (#91596)

* chore: preallocate slices where we have a good idea of requirements

* pr feedback
This commit is contained in:
Kristin Laemmert
2024-08-07 08:34:52 -04:00
committed by GitHub
parent 9b652612bd
commit a117b090cf
4 changed files with 6 additions and 6 deletions

View File

@ -191,7 +191,7 @@ func eraseAny(value string, strToErase ...string) string {
if len(strToErase) == 0 {
return value
}
var replaceSeq []string
replaceSeq := make([]string, 0, len(strToErase)*2)
for _, s := range strToErase {
replaceSeq = append(replaceSeq, s, "")
}