MCPcopy Index your code
hub / github.com/Effect-TS/effect / nextMapped

Function nextMapped

packages/effect/src/Graph.ts:3275–3302  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3273 const discovered = new Set<NodeIndex>()
3274
3275 const nextMapped = () => {
3276 while (stack.length > 0) {
3277 const current = stack.pop()!
3278
3279 if (discovered.has(current)) {
3280 continue
3281 }
3282
3283 discovered.add(current)
3284
3285 const nodeDataOption = graph.nodes.get(current)
3286 if (nodeDataOption === undefined) {
3287 continue
3288 }
3289
3290 const neighbors = getTraversalNeighbors(graph, current, direction)
3291 for (let i = neighbors.length - 1; i >= 0; i--) {
3292 const neighbor = neighbors[i]
3293 if (!discovered.has(neighbor)) {
3294 stack.push(neighbor)
3295 }
3296 }
3297
3298 return { done: false, value: f(current, nodeDataOption) }
3299 }
3300
3301 return { done: true, value: undefined } as const
3302 }
3303
3304 return { next: nextMapped }
3305 }

Callers

nothing calls this directly

Calls 8

getTraversalNeighborsFunction · 0.85
getNodeFunction · 0.85
neighborsDirectedFunction · 0.85
fFunction · 0.70
addMethod · 0.65
getMethod · 0.65
setMethod · 0.65
nextMethod · 0.65

Tested by

no test coverage detected