Skip to content
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

Fix typos #183

Merged
merged 1 commit into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This library is part of the [awesome go collection](https://github.com/avelino/a
* [beego](https://github.com/beego/beego)
* [CubeFS](https://github.com/cubefs/cubefs)
* [Amazon EKS Distro](https://github.com/aws/eks-distro)
* [sourcegraph](https://github.com/sourcegraph/sourcegraph)
* [sourcegraph](https://github.com/sourcegraph/sourcegraph-public-snapshot)
* [torrent](https://github.com/anacrolix/torrent)


Expand Down Expand Up @@ -125,7 +125,7 @@ E.g.,

## Memory Usage

The memory usage of a bitset using `N` bits is at least `N/8` bytes. The number of bits in a bitset is at least as large as one plus the greatest bit index you have accessed. Thus it is possible to run out of memory while using a bitset. If you have lots of bits, you might prefer compressed bitsets, like the [Roaring bitmaps](http://roaringbitmap.org) and its [Go implementation](https://github.com/RoaringBitmap/roaring).
The memory usage of a bitset using `N` bits is at least `N/8` bytes. The number of bits in a bitset is at least as large as one plus the greatest bit index you have accessed. Thus it is possible to run out of memory while using a bitset. If you have lots of bits, you might prefer compressed bitsets, like the [Roaring bitmaps](https://roaringbitmap.org) and its [Go implementation](https://github.com/RoaringBitmap/roaring).

The `roaring` library allows you to go back and forth between compressed Roaring bitmaps and the conventional bitset instances:
```Go
Expand Down
4 changes: 2 additions & 2 deletions bitset.go
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ func (b *BitSet) Difference(compare *BitSet) (result *BitSet) {
return
}

// DifferenceCardinality computes the cardinality of the differnce
// DifferenceCardinality computes the cardinality of the difference
func (b *BitSet) DifferenceCardinality(compare *BitSet) uint {
panicIfNull(b)
panicIfNull(compare)
Expand Down Expand Up @@ -1277,7 +1277,7 @@ func (b *BitSet) UnmarshalJSON(data []byte) error {
return err
}

// Rank returns the nunber of set bits up to and including the index
// Rank returns the number of set bits up to and including the index
// that are set in the bitset.
// See https://en.wikipedia.org/wiki/Ranking#Ranking_in_statistics
func (b *BitSet) Rank(index uint) uint {
Expand Down
10 changes: 5 additions & 5 deletions bitset_benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func BenchmarkBitsetOps(b *testing.B) {
}

// go test -bench=LemireCreate
// see http://lemire.me/blog/2016/09/22/swift-versus-java-the-bitset-performance-test/
// see https://lemire.me/blog/2016/09/22/swift-versus-java-the-bitset-performance-test/
func BenchmarkLemireCreate(b *testing.B) {
for i := 0; i < b.N; i++ {
bitmap := New(0) // we force dynamic memory allocation
Expand All @@ -200,7 +200,7 @@ func BenchmarkLemireCreate(b *testing.B) {
}

// go test -bench=LemireCount
// see http://lemire.me/blog/2016/09/22/swift-versus-java-the-bitset-performance-test/
// see https://lemire.me/blog/2016/09/22/swift-versus-java-the-bitset-performance-test/
func BenchmarkLemireCount(b *testing.B) {
bitmap := New(100000000)
for v := uint(0); v <= 100000000; v += 100 {
Expand All @@ -217,7 +217,7 @@ func BenchmarkLemireCount(b *testing.B) {
}

// go test -bench=LemireIterate
// see http://lemire.me/blog/2016/09/22/swift-versus-java-the-bitset-performance-test/
// see https://lemire.me/blog/2016/09/22/swift-versus-java-the-bitset-performance-test/
func BenchmarkLemireIterate(b *testing.B) {
bitmap := New(100000000)
for v := uint(0); v <= 100000000; v += 100 {
Expand All @@ -236,7 +236,7 @@ func BenchmarkLemireIterate(b *testing.B) {
}

// go test -bench=LemireIterateb
// see http://lemire.me/blog/2016/09/22/swift-versus-java-the-bitset-performance-test/
// see https://lemire.me/blog/2016/09/22/swift-versus-java-the-bitset-performance-test/
func BenchmarkLemireIterateb(b *testing.B) {
bitmap := New(100000000)
for v := uint(0); v <= 100000000; v += 100 {
Expand All @@ -256,7 +256,7 @@ func BenchmarkLemireIterateb(b *testing.B) {
}

// go test -bench=BenchmarkLemireIterateManyb
// see http://lemire.me/blog/2016/09/22/swift-versus-java-the-bitset-performance-test/
// see https://lemire.me/blog/2016/09/22/swift-versus-java-the-bitset-performance-test/
func BenchmarkLemireIterateManyb(b *testing.B) {
bitmap := New(100000000)
for v := uint(0); v <= 100000000; v += 100 {
Expand Down
2 changes: 1 addition & 1 deletion popcnt_amd64_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build !go1.9 && amd64 && !appengine
// +build !go1.9,amd64,!appengine

// This file tests the popcnt funtions
// This file tests the popcnt functions

package bitset

Expand Down
2 changes: 1 addition & 1 deletion popcnt_cmp_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build !go1.9 && amd64 && !appengine
// +build !go1.9,amd64,!appengine

// This file tests the popcnt funtions
// This file tests the popcnt functions

package bitset

Expand Down
2 changes: 1 addition & 1 deletion popcnt_go18_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file tests the popcnt funtions
// This file tests the popcnt functions

package bitset

Expand Down
2 changes: 1 addition & 1 deletion popcnt_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file tests the popcnt funtions
// This file tests the popcnt functions

package bitset

Expand Down
Loading