diff --git a/fragment.go b/fragment.go index ac1c14061..1614c2163 100644 --- a/fragment.go +++ b/fragment.go @@ -566,7 +566,7 @@ func (f *fragment) sum(filter *Row, bitDepth uint) (sum, count uint64, err error // Compute count based on the existence row. row := f.row(uint64(bitDepth)) if filter != nil { - count = row.IntersectionCount(filter) + count = row.intersectionCount(filter) } else { count = row.Count() } @@ -582,7 +582,7 @@ func (f *fragment) sum(filter *Row, bitDepth uint) (sum, count uint64, err error row := f.row(uint64(i)) cnt := uint64(0) if filter != nil { - cnt = row.IntersectionCount(filter) + cnt = row.intersectionCount(filter) } else { cnt = row.Count() } @@ -938,7 +938,7 @@ func (f *fragment) top(opt topOptions) ([]Pair, error) { // Calculate count and append. count := cnt if opt.Src != nil { - count = opt.Src.IntersectionCount(f.row(rowID)) + count = opt.Src.intersectionCount(f.row(rowID)) } if count == 0 { continue @@ -982,7 +982,7 @@ func (f *fragment) top(opt topOptions) ([]Pair, error) { // Calculate the intersecting column count and skip if it's below our // last row in our current result set. - count := opt.Src.IntersectionCount(f.row(rowID)) + count := opt.Src.intersectionCount(f.row(rowID)) if count < threshold { continue } diff --git a/fragment_internal_test.go b/fragment_internal_test.go index 4ceb33819..e665a10ba 100644 --- a/fragment_internal_test.go +++ b/fragment_internal_test.go @@ -1063,7 +1063,7 @@ func BenchmarkFragment_IntersectionCount(b *testing.B) { // Start benchmark b.ResetTimer() for i := 0; i < b.N; i++ { - if n := f.row(1).IntersectionCount(f.row(2)); n == 0 { + if n := f.row(1).intersectionCount(f.row(2)); n == 0 { b.Fatalf("unexpected count: %d", n) } } diff --git a/row.go b/row.go index a78002034..125fec08c 100644 --- a/row.go +++ b/row.go @@ -66,8 +66,8 @@ func (r *Row) Merge(other *Row) { r.InvalidateCount() } -// IntersectionCount returns the number of intersections between r and other. -func (r *Row) IntersectionCount(other *Row) uint64 { +// intersectionCount returns the number of intersections between r and other. +func (r *Row) intersectionCount(other *Row) uint64 { var n uint64 itr := newMergeSegmentIterator(r.segments, other.segments)