Skip to content

Commit 9ef9782

Browse files
aledbfclaude
andcommitted
refactor(features): drop the capacity hint in PropertyOrder
CodeQL's go/allocation-size-overflow flagged the sum of two lengths used as a make capacity. The hint bought nothing measurable, so the slice grows on append instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 9a99423 commit 9ef9782

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎internal/features/jsobject.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func KeyOrder(keys []string) []string {
9191
// PropertyOrder is KeyOrder of m's keys as declared, followed by the keys of
9292
// m that declared does not name (a map a caller built), sorted.
9393
func PropertyOrder[V any](m map[string]V, declared []string) []string {
94-
keys := make([]string, 0, len(declared)+len(m))
94+
var keys []string
9595
for _, k := range declared {
9696
if _, ok := m[k]; ok {
9797
keys = append(keys, k)

0 commit comments

Comments
 (0)