Skip to content

Commit

Permalink
shared/api/status_code: pre-allocate statusStrings
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Dec 20, 2024
1 parent ca1cff9 commit f267afa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shared/api/status_code.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ func StatusCodeFromString(status string) StatusCode {
}

// GetAllStatusCodeStrings returns a slice of all status code strings.
func GetAllStatusCodeStrings() []string {
var statusStrings []string
func GetAllStatusCodeStrings() (statusStrings []string) {
statusStrings = make([]string, 0, len(StatusCodeNames))
for _, code := range StatusCodeNames {
statusStrings = append(statusStrings, code)
}
Expand Down

0 comments on commit f267afa

Please sign in to comment.