Skip to content

Commit

Permalink
Merge pull request #183 from deining/fix-typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
lemire authored Nov 30, 2024
2 parents 41291a4 + cc521ad commit 4e370e5
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
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

0 comments on commit 4e370e5

Please sign in to comment.