Skip to content

Commit

Permalink
code simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Aug 24, 2024
1 parent 12944a5 commit 467471f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bitset.go
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ func (b *BitSet) ShiftLeft(bits uint) {
}

// capacity check
if top+bits >= Cap() {
if top+bits < bits {
panic("You are exceeding the capacity")
}

Expand All @@ -1230,7 +1230,7 @@ func (b *BitSet) ShiftLeft(bits uint) {
// not using extendSet() to avoid unneeded data copying
nsize := wordsNeeded(top + bits)
if len(b.set) < nsize {
dst = make([]uint64, nsize, 2*nsize)
dst = make([]uint64, nsize)
}
if top+bits >= b.length {
b.length = top + bits + 1
Expand Down

0 comments on commit 467471f

Please sign in to comment.