Skip to content

Tip #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 8, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve doc for And/Or
  • Loading branch information
korthaj committed May 7, 2017
commit e01afd618490cd57a1c3106fb73c6ad589fae970
16 changes: 8 additions & 8 deletions filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ func (f *Filter) Count() int64 {
}

// And returns a new Bloom filter that consists of all elements
// that belong to both f1 and f2. It requires two filters with
// the same size and the same false-positives rate.
// that belong to both f1 and f2. The two filters must be of
// the same size and have the same false-positives rate.
//
// The false-positive rate of the resulting filter is at most
// the false-positive rate of f1 and f2, but may be larger than
// the rate of the filter created from scratch using the intersection
// of the two sets.
// The false-positive rate of the resulting filter is bounded by
// the maximum false-positive rate of f1 and f2, but it may be larger
// than the rate of the filter created from scratch using
// the intersection of the two sets.
func (f1 *Filter) And(f2 *Filter) *Filter {
if len(f1.data) != len(f2.data) || f1.lookups != f2.lookups {
panic("operation requires filters of the same type")
Expand All @@ -154,8 +154,8 @@ func (f1 *Filter) And(f2 *Filter) *Filter {
}

// Or returns a new Bloom filter that consists of all elements
// that belong to either f1 or f2. It requires two filters with
// the same size and the same false-positives rate.
// that belong to either f1 or f2. The two filters must be of
// the same size and have the same false-positives rate.
//
// The resulting filter is the same as the filter created from scratch
// using the union of the two sets.
Expand Down