def path.clone.pair.go

mylsm-lsm-store@0.6.0.1 · src/ByteDurableDb.bend:715

import mylsm-lsm-store@0.6.0.1/src/ByteDurableDb.bend as ByteDurableDb
import Base

715# Rebuilds two identical paths in one traversal.
716def path.clone.pair.go(
717  path: String,
718  copies: String & String
719) -> String & String:
720  match path:
721    case SNil{}:
722      match copies:
723        case (first, second):
724          (path.reverse(first, SNil{}), path.reverse(second, SNil{}))
725    case SCon{Chr{+scalar}, rest}:
726      match copies:
727        case (first, second):
728          path.clone.pair.go(rest, path.clone.pair.scalar(first, second,
729            duplicate_nat_pair(U32.to_nat(scalar))))

Uses (8)

Used by (1)