def clone.split

mylsm-lsm-store@0.6.0.1 · src/ByteSstFile.bend:64

import mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend as ByteSstFile
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

64# Clones bytes when output and hashing both need the same contents.
65def clone.split(bytes: Bytes.Bytes) -> Bytes.Bytes & Bytes.Bytes:
66  match bytes:
67    case Bytes.Bytes{+len, buf}:
68      clone.pair(len, Bytes.copy.bytes(len, buf, Bytes.alloc(len), 0, 0))

Uses (5)

Used by (23)