Skip to content

Commit

Permalink
PR Suggestion - remove length variable
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Jul 13, 2022
1 parent fac4858 commit ce8d4dc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions query/graphql/planner/count.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ func (n *countNode) Next() (bool, error) {
switch v.Kind() {
// v.Len will panic if v is not one of these types, we don't want it to panic
case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice, reflect.String:
length := v.Len()

if source.Filter != nil {
switch array := property.(type) {
case []core.Doc:
Expand Down Expand Up @@ -158,7 +156,7 @@ func (n *countNode) Next() (bool, error) {
}
}
} else {
count = count + length
count = count + v.Len()
}
}
}
Expand Down

0 comments on commit ce8d4dc

Please sign in to comment.