Skip to content

Commit b216ae8

Browse files
ipinakpd93
andauthored
perf: pre-allocate known length arrays (#2354)
Co-authored-by: Pete Davison <[email protected]>
1 parent 61cb15a commit b216ae8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

errors/errors_task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func (v MissingVar) String() string {
162162
}
163163

164164
func (err *TaskMissingRequiredVarsError) Error() string {
165-
var vars []string
165+
vars := make([]string, 0, len(err.MissingVars))
166166
for _, v := range err.MissingVars {
167167
vars = append(vars, v.String())
168168
}

0 commit comments

Comments
 (0)