Function
enqueue
(targets: Uint32Array, offsets: Uint32Array, current: number, depth: number)
Source from the content-addressed store, hash-verified
| 7947 | } |
| 7948 | |
| 7949 | const enqueue = (targets: Uint32Array, offsets: Uint32Array, current: number, depth: number) => { |
| 7950 | for (let i = offsets[current]; i < offsets[current + 1]; i++) { |
| 7951 | const neighbor = targets[i] |
| 7952 | if (reached[neighbor] === 0) { |
| 7953 | reached[neighbor] = 1 |
| 7954 | queue[tail] = neighbor |
| 7955 | depths[tail++] = depth + 1 |
| 7956 | } |
| 7957 | } |
| 7958 | } |
| 7959 | |
| 7960 | while (head < tail) { |
| 7961 | const current = queue[head] |
Tested by
no test coverage detected