Skip to content

Commit 8c11268

Browse files
committed
perf: preallocate slice with known length to optimize Mem Allocs
1 parent cfe6c55 commit 8c11268

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/compiler/query_catalog.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (qc QueryCatalog) GetTable(rel *ast.TableName) (*Table, error) {
8686
if err != nil {
8787
return nil, err
8888
}
89-
var cols []*Column
89+
cols := make([]*Column, 0, len(src.Columns))
9090
for _, c := range src.Columns {
9191
cols = append(cols, ConvertColumn(rel, c))
9292
}

0 commit comments

Comments
 (0)