def qrm
bend-collections@1.0.0.0 · src/containers/lru.bend:666
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
666
667
668def qrm(a, -V: Kind(a), fuel: Nat, s: H.QStep, +mask: U32, +w: U32, +i: U32, +cap: U32, +n: U32, +head: U32, +tail: U32, +free: U32, m: Array<U32>, ks: Array<String>, ents: Array<Maybe<a, V>>, lk: Array<U32>) -> LRU<a, V> & Maybe<a, V>:
669 match fuel s:
670 case 0n H.QEnd{tab}:
671 (F{cap, n, head, tail, free, m, tab, ks, ents, lk}, None{})
672 case 0n H.QHit{tab, +l}:
673 drop_slot(a, V, F{cap, n, head, tail, free, m, H.del_at(tab, mask, i), ks, ents, lk}, H.slot(l), 2)
674 case 0n H.QNext{tab}:
675 (F{cap, n, head, tail, free, m, tab, ks, ents, lk}, None{})
676 case 1n+p H.QEnd{tab}:
677 (F{cap, n, head, tail, free, m, tab, ks, ents, lk}, None{})
678 case 1n+p H.QHit{tab, +l}:
679 drop_slot(a, V, F{cap, n, head, tail, free, m, H.del_at(tab, mask, i), ks, ents, lk}, H.slot(l), 2)
680 case 1n+p H.QNext{tab}:
681 +j = H.bnext(i, mask)
682 qrm(a, V, p, H.qstep(tab, j, w), mask, w, j, cap, n, head, tail, free, m, ks, ents, lk)