def clone.split

mylsm-lsm-store@0.6.0.1 · src/scan/ByteRange.bend:11

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

11# Clones a byte buffer when range checks need both bounds.
12def clone.split(bytes: Bytes.Bytes) -> Bytes.Bytes & Bytes.Bytes:
13  match bytes:
14    case Bytes.Bytes{+len, buf}:
15      clone.pair(len, Bytes.copy.bytes(len, buf, Bytes.alloc(len), 0, 0))

Uses (5)

Used by (1)