File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed
src/library/scala/collection Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ trait BitSetLike[+This <: BitSetLike[This] with SortedSet[Int]] extends SortedSe
6565 var i = nwords
6666 while (i > 0 ) {
6767 i -= 1
68- s += popCount (word(i))
68+ s += java.lang. Long .bitCount (word(i))
6969 }
7070 s
7171 }
@@ -221,15 +221,4 @@ object BitSetLike {
221221 else assert(w == 0L )
222222 newelems
223223 }
224-
225- private val pc1 : Array [Int ] = {
226- def countBits (x : Int ): Int = if (x == 0 ) 0 else x % 2 + countBits(x >>> 1 )
227- Array .tabulate(256 )(countBits _)
228- }
229-
230- private def popCount (w : Long ): Int = {
231- def pc2 (w : Int ) = if (w == 0 ) 0 else pc1(w & 0xff ) + pc1(w >>> 8 )
232- def pc4 (w : Int ) = if (w == 0 ) 0 else pc2(w & 0xffff ) + pc2(w >>> 16 )
233- if (w == 0L ) 0 else pc4(w.toInt) + pc4((w >>> 32 ).toInt)
234- }
235224}
You can’t perform that action at this time.
0 commit comments