Skip to content

Commit

Permalink
Replace sliceCount with boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
nussjustin committed Aug 8, 2015
1 parent debbfda commit 56cd151
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ func In(query string, args ...interface{}) (string, []interface{}, error) {
length int
}

var flatArgsCount, sliceCount int
var flatArgsCount int
var anySlices bool

meta := make([]argMeta, len(args))

Expand All @@ -115,7 +116,7 @@ func In(query string, args ...interface{}) (string, []interface{}, error) {
meta[i].length = v.Len()
meta[i].v = v

sliceCount++
anySlices = true
flatArgsCount += meta[i].length

if meta[i].length == 0 {
Expand All @@ -129,7 +130,7 @@ func In(query string, args ...interface{}) (string, []interface{}, error) {

// don't do any parsing if there aren't any slices; note that this means
// some errors that we might have caught below will not be returned.
if sliceCount == 0 {
if !anySlices {
return query, args, nil
}

Expand Down

0 comments on commit 56cd151

Please sign in to comment.