File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ func (bs BitSet) Equal(other BitSet) bool {
7070 if len (bs ) != len (other ) {
7171 return false
7272 }
73- for i := 0 ; i < len ( bs ); i ++ {
73+ for i := range bs {
7474 if bs [i ] != other [i ] {
7575 return false
7676 }
@@ -83,7 +83,7 @@ func (bs BitSet) Subset(other BitSet) bool {
8383 if len (bs ) > len (other ) {
8484 return false
8585 }
86- for i := 0 ; i < len ( bs ); i ++ {
86+ for i := range bs {
8787 if bs [i ]&^other [i ] != 0 {
8888 return false
8989 }
@@ -132,8 +132,8 @@ func (bs BitSet) Next(m int) int {
132132 if i >= l {
133133 return - 1
134134 }
135- t := 1 + uint (m & div64rem )
136- w := bs [i ] >> t << t // zero out bits for numbers ≤ m
135+ t := uint (m & div64rem ) + 1 // the next bit position after m in the word
136+ w := bs [i ] >> t << t // zero out bits for numbers ≤ m
137137 for i < l - 1 && w == 0 {
138138 i ++
139139 w = bs [i ]
@@ -181,9 +181,6 @@ func (bs BitSet) Prev(m int) int {
181181func (bs BitSet ) Visit (do func (n int ) bool ) (aborted bool ) {
182182 for i , l := 0 , len (bs ); i < l ; i ++ {
183183 w := bs [i ]
184- if w == 0 {
185- continue
186- }
187184 n := i << shift
188185 for w != 0 {
189186 b := bits .TrailingZeros64 (w )
You can’t perform that action at this time.
0 commit comments