def insert_checked_reuse
bend-collections@1.0.0.0 · src/containers/internal/dlist_storage.bend:550
import bend-collections@1.0.0.0/src/containers/internal/dlist_storage.bend as DlistStorage
import Base
import bend-collections@1.0.0.0/src/containers/types/internal_dlist.bend as E
550def insert_checked_reuse(~T: Data, after: Bool, ok: Bool, +tag: U32, +fresh: U32, +free: U32, +count: Nat, +head: U32, +tail: U32, +depth: Nat, +cap: U32, vals: Array<Maybe<&2, T>>, prevs: Array<U32>, nexts: Array<U32>, +i: U32, x: T, same: Bool) -> DList<T> & Result<&2, &2, E.Error, E.Handle>:
551 match ok same:
552 case _ False{}:
553 (DL{tag, fresh, free, count, head, tail, depth, cap, vals, prevs, nexts}, Fail{E.ForeignHandle{}})
554 case False{} True{}:
555 (DL{tag, fresh, free, count, head, tail, depth, cap, vals, prevs, nexts}, Fail{E.StaleHandle{}})
556 case True{} True{}:
557 ins_found_reuse(~T, after, tag, fresh, free, count, head, tail, depth, cap, prevs, nexts, i, x, Array.get(Maybe<&2, T>, vals, i))