MCPcopy
hub / github.com/facebook/react / getLeadingBit

Function getLeadingBit

packages/react-server/src/ReactFizzTreeContext.js:150–152  ·  view source on GitHub ↗
(id: number)

Source from the content-addressed store, hash-verified

148}
149
150function getLeadingBit(id: number) {
151 return 1 << (getBitLength(id) - 1);
152}
153
154// TODO: Math.clz32 is supported in Node 12+. Maybe we can drop the fallback.
155const clz32 = Math.clz32 ? Math.clz32 : clz32Fallback;

Callers 1

getTreeIdFunction · 0.70

Calls 1

getBitLengthFunction · 0.70

Tested by

no test coverage detected