(mapResult, keyPrefix, mapFunction, mapContext)
| 1976 | var POOL_SIZE = 10; |
| 1977 | var traverseContextPool = []; |
| 1978 | function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) { |
| 1979 | if (traverseContextPool.length) { |
| 1980 | var traverseContext = traverseContextPool.pop(); |
| 1981 | traverseContext.result = mapResult; |
| 1982 | traverseContext.keyPrefix = keyPrefix; |
| 1983 | traverseContext.func = mapFunction; |
| 1984 | traverseContext.context = mapContext; |
| 1985 | traverseContext.count = 0; |
| 1986 | return traverseContext; |
| 1987 | } else { |
| 1988 | return { |
| 1989 | result: mapResult, |
| 1990 | keyPrefix: keyPrefix, |
| 1991 | func: mapFunction, |
| 1992 | context: mapContext, |
| 1993 | count: 0 |
| 1994 | }; |
| 1995 | } |
| 1996 | } |
| 1997 | |
| 1998 | function releaseTraverseContext(traverseContext) { |
| 1999 | traverseContext.result = null; |
no outgoing calls
no test coverage detected