Skip to content

Commit

Permalink
early exit
Browse files Browse the repository at this point in the history
  • Loading branch information
black-adder committed Jan 31, 2019
1 parent 4288499 commit a2b703f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion values/decoding/dictionary_based_int_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ func newDictionaryBasedIntIterator(

// Next iteration.
func (it *dictionaryBasedIntIterator) Next() bool {
if it.err != nil {
// Bail early if dictionary is empty, ie values is also empty.
if it.err != nil || len(it.extDict) == 0 {
return false
}

Expand Down
3 changes: 2 additions & 1 deletion values/decoding/dictionary_based_string_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ func newDictionaryBasedStringIterator(

// Next iteration.
func (it *dictionaryBasedStringIterator) Next() bool {
if it.err != nil {
// Bail early if dictionary is empty, ie values is also empty.
if it.err != nil || len(it.extDict) == 0 {
return false
}

Expand Down

0 comments on commit a2b703f

Please sign in to comment.