MCPcopy Create free account
hub / github.com/microsoft/SandDance / getPooledTraverseContext

Function getPooledTraverseContext

docs/external/js/react.development.js:1022–1040  ·  view source on GitHub ↗
(mapResult, keyPrefix, mapFunction, mapContext)

Source from the content-addressed store, hash-verified

1020 var traverseContextPool = [];
1021
1022 function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
1023 if (traverseContextPool.length) {
1024 var traverseContext = traverseContextPool.pop();
1025 traverseContext.result = mapResult;
1026 traverseContext.keyPrefix = keyPrefix;
1027 traverseContext.func = mapFunction;
1028 traverseContext.context = mapContext;
1029 traverseContext.count = 0;
1030 return traverseContext;
1031 } else {
1032 return {
1033 result: mapResult,
1034 keyPrefix: keyPrefix,
1035 func: mapFunction,
1036 context: mapContext,
1037 count: 0
1038 };
1039 }
1040 }
1041
1042 function releaseTraverseContext(traverseContext) {
1043 traverseContext.result = null;

Callers 2

forEachChildrenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected