diff --git a/lib/logstorage/filter.go b/lib/logstorage/filter.go index d3cce634d..7b234cef2 100644 --- a/lib/logstorage/filter.go +++ b/lib/logstorage/filter.go @@ -24,15 +24,15 @@ type filter interface { apply(bs *blockSearch, bm *bitmap) } -// noopFilter does nothing -type noopFilter struct { +// filterNoop does nothing +type filterNoop struct { } -func (nf *noopFilter) String() string { +func (fn *filterNoop) String() string { return "" } -func (nf *noopFilter) apply(_ *blockSearch, _ *bitmap) { +func (fn *filterNoop) apply(_ *blockSearch, _ *bitmap) { // nothing to do } @@ -168,21 +168,21 @@ type notFilter struct { f filter } -func (nf *notFilter) String() string { - s := nf.f.String() - switch nf.f.(type) { +func (fn *notFilter) String() string { + s := fn.f.String() + switch fn.f.(type) { case *andFilter, *orFilter: s = "(" + s + ")" } return "!" + s } -func (nf *notFilter) apply(bs *blockSearch, bm *bitmap) { +func (fn *notFilter) apply(bs *blockSearch, bm *bitmap) { // Minimize the number of rows to check by the filter by applying it // only to the rows, which match the bm, e.g. they may change the bm result. bmTmp := getBitmap(bm.bitsLen) bmTmp.copyFrom(bm) - nf.f.apply(bs, bmTmp) + fn.f.apply(bs, bmTmp) bm.andNot(bmTmp) putBitmap(bmTmp) } diff --git a/lib/logstorage/storage_search.go b/lib/logstorage/storage_search.go index af16ce987..f67ba754c 100644 --- a/lib/logstorage/storage_search.go +++ b/lib/logstorage/storage_search.go @@ -708,7 +708,7 @@ func getCommonStreamFilter(f filter) (*StreamFilter, filter) { } } case *streamFilter: - return t.f, &noopFilter{} + return t.f, &filterNoop{} } return nil, f }