MCPcopy
hub / github.com/prisma/prisma / countBits

Function countBits

packages/client/src/__tests__/buffer-small.test.ts:3050–3056  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

3048
3049 // countBits returns the number of bits in the binary representation of n.
3050 function countBits(n) {
3051 let count
3052 for (count = 0; n > 0; count++) {
3053 n = n & (n - 1) // remove top bit
3054 }
3055 return count
3056 }
3057 const parts = []
3058 for (let i = 0; i < 1000000; i++) {
3059 // @ts-ignore

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected