Skip to content

Commit

Permalink
Pre-allocate mem for collectFields() method result slice
Browse files Browse the repository at this point in the history
  • Loading branch information
asp24 authored and asp24 committed Apr 17, 2019
1 parent 88cdbdf commit 5dfa228
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion graphql/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func CollectFields(ctx context.Context, selSet ast.SelectionSet, satisfies []str
}

func collectFields(reqCtx *RequestContext, selSet ast.SelectionSet, satisfies []string, visited map[string]bool) []CollectedField {
var groupedFields []CollectedField
groupedFields := make([]CollectedField, 0, len(selSet))

for _, sel := range selSet {
switch sel := sel.(type) {
Expand Down

0 comments on commit 5dfa228

Please sign in to comment.