Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-ramon authored Apr 13, 2018
2 parents 047e926 + c35670f commit b3592ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func executeFieldsSerially(p executeFieldsParams) *Result {
p.Fields = map[string][]*ast.Field{}
}

finalResults := map[string]interface{}{}
finalResults := make(map[string]interface{}, len(p.Fields))
for responseName, fieldASTs := range p.Fields {
resolved, state := resolveField(p.ExecutionContext, p.ParentType, p.Source, fieldASTs)
if state.hasNoFieldDefs {
Expand All @@ -279,7 +279,7 @@ func executeFields(p executeFieldsParams) *Result {
p.Fields = map[string][]*ast.Field{}
}

finalResults := map[string]interface{}{}
finalResults := make(map[string]interface{}, len(p.Fields))
for responseName, fieldASTs := range p.Fields {
resolved, state := resolveField(p.ExecutionContext, p.ParentType, p.Source, fieldASTs)
if state.hasNoFieldDefs {
Expand Down Expand Up @@ -791,7 +791,7 @@ func completeListValue(eCtx *executionContext, returnType *List, fieldASTs []*as
}

itemType := returnType.OfType
completedResults := []interface{}{}
completedResults := make([]interface{}, 0, resultVal.Len())
for i := 0; i < resultVal.Len(); i++ {
val := resultVal.Index(i).Interface()
completedItem := completeValueCatchingError(eCtx, itemType, fieldASTs, info, val)
Expand Down

0 comments on commit b3592ac

Please sign in to comment.