def mr_pick

bend-collections@1.0.0.0 · src/containers/lru.bend:378

import bend-collections@1.0.0.0/src/containers/lru.bend as Lru
import Base
import bend-collections@1.0.0.0/src/containers/hash_table.bend as H

378def mr_pick(a, -V: Kind(a), +cap: U32, +n: U32, +head: U32, +tail: U32, +free: U32, m: Array<U32>, tab: Array<U32>, ks: Array<String>, ents: Array<Maybe<a, V>>, lk: Array<U32>, key: String, +at: U32, +h: U32, e: Ent<a, V>, none: Bool) -> LRU<a, V>:
379  match none:
380    case True{}:
381      mr_fresh(a, V, cap, n, head, tail, tab, ks, ents, lk, key, at, h, e, Array.get(U32, m, 0))
382    case False{}:
383      free_next(a, V, cap, n, head, tail, H.slot(free), m, H.put_bucket(tab, at, h, free), ks, ents, key, h, e, Array.get(U32, lk, nidx(H.slot(free))))

Uses (13)

Used by (1)