Skip to content

Commit 3ba45a7

Browse files
committed
perf: preallocate sortStringExprs chunk slice size
1 parent 77b9b38 commit 3ba45a7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

build/rewrite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ func sortStringExprs(list []Expr) []Expr {
672672
}
673673
}
674674

675-
var chunk []stringSortKey
675+
chunk := make([]stringSortKey, 0, j-i)
676676
for index, x := range list[i:j] {
677677
chunk = append(chunk, makeSortKey(index, x.(*StringExpr)))
678678
}

0 commit comments

Comments
 (0)