MCPcopy Index your code
hub / github.com/caseywebdev/react-list / pushTreeId

Function pushTreeId

docs/index.js:5969–5997  ·  view source on GitHub ↗
(workInProgress, totalChildren, index)

Source from the content-addressed store, hash-verified

5967 treeForkCount = totalChildren;
5968}
5969function pushTreeId(workInProgress, totalChildren, index) {
5970 idStack[idStackIndex++] = treeContextId;
5971 idStack[idStackIndex++] = treeContextOverflow;
5972 idStack[idStackIndex++] = treeContextProvider;
5973 treeContextProvider = workInProgress;
5974 var baseIdWithLeadingBit = treeContextId;
5975 workInProgress = treeContextOverflow;
5976 var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
5977 baseIdWithLeadingBit &= ~(1 << baseLength);
5978 index += 1;
5979 var length = 32 - clz32(totalChildren) + baseLength;
5980 if (30 < length) {
5981 var numberOfOverflowBits = baseLength - (baseLength % 5);
5982 length = (
5983 baseIdWithLeadingBit &
5984 ((1 << numberOfOverflowBits) - 1)
5985 ).toString(32);
5986 baseIdWithLeadingBit >>= numberOfOverflowBits;
5987 baseLength -= numberOfOverflowBits;
5988 treeContextId =
5989 (1 << (32 - clz32(totalChildren) + baseLength)) |
5990 (index << baseLength) |
5991 baseIdWithLeadingBit;
5992 treeContextOverflow = length + workInProgress;
5993 } else
5994 (treeContextId =
5995 (1 << length) | (index << baseLength) | baseIdWithLeadingBit),
5996 (treeContextOverflow = workInProgress);
5997}
5998function pushMaterializedTreeId(workInProgress) {
5999 null !== workInProgress.return &&
6000 (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0));

Callers 2

pushMaterializedTreeIdFunction · 0.85
beginWorkFunction · 0.85

Calls 1

warnIfNotHydratingFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…