Chore: Use strings.ReplaceAll and preallocate containers (#58483)

This commit is contained in:
Sasha Melentyev
2022-11-09 17:17:09 +01:00
committed by GitHub
parent 2dfe0a4060
commit febcaeff3a
6 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -165,7 +165,7 @@ func (r RoleDTO) MarshalJSON() ([]byte, error) {
func fallbackDisplayName(rName string) string {
// removing prefix for fixed roles
rNameWithoutPrefix := strings.Replace(rName, FixedRolePrefix, "", 1)
return strings.TrimSpace(strings.Replace(rNameWithoutPrefix, ":", " ", -1))
return strings.TrimSpace(strings.ReplaceAll(rNameWithoutPrefix, ":", " "))
}
type TeamRole struct {