Skip to content

Commit

Permalink
isNullPage is a function, not a method, since receiver is unused
Browse files Browse the repository at this point in the history
  • Loading branch information
jhump committed Sep 23, 2024
1 parent af3266d commit 8bb75a2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions column_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,20 @@ func (i fileColumnIndex) NullCount(j int) int64 {
}

func (i fileColumnIndex) NullPage(j int) bool {
return i.nullPage(j, i.columnIndex())
}

func (i fileColumnIndex) nullPage(j int, index *format.ColumnIndex) bool {
return len(index.NullPages) > 0 && index.NullPages[j]
return isNullPage(j, i.columnIndex())
}

func (i fileColumnIndex) MinValue(j int) Value {
index := i.columnIndex()
if i.nullPage(j, index) {
if isNullPage(j, index) {
return Value{}
}
return i.makeValue(index.MinValues[j])
}

func (i fileColumnIndex) MaxValue(j int) Value {
index := i.columnIndex()
if i.nullPage(j, index) {
if isNullPage(j, index) {
return Value{}
}
return i.makeValue(index.MaxValues[j])
Expand All @@ -136,6 +132,10 @@ func (i *fileColumnIndex) makeValue(b []byte) Value {

func (i fileColumnIndex) columnIndex() *format.ColumnIndex { return i.chunk.columnIndex.Load() }

func isNullPage(j int, index *format.ColumnIndex) bool {
return len(index.NullPages) > 0 && index.NullPages[j]
}

type emptyColumnIndex struct{}

func (emptyColumnIndex) NumPages() int { return 0 }
Expand Down

0 comments on commit 8bb75a2

Please sign in to comment.