def copy.go

bend-kit-bytes@0.3.3.0 · bytes.bend:57

import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
import Base

57# n bytes from src[s..] to dst[d..], one byte at a time.
58def copy.go(n: Nat, r: Array<U32> & U32, dst: Array<U32>, +s: U32, +d: U32) -> Array<U32> & Array<U32>:
59  match n:
60    case 0n:
61      (a, v) = r
62      (a, dst)
63    case 1n+p:
64      (a, v) = r
65      copy.go(p, peek(a, (s + 1 : U32)), poke(dst, d, v), (s + 1 : U32), (d + 1 : U32))

Uses (8)

Used by (1)