def link_tail

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

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

169# Attach slot s as the newest.
170def link_tail(a, -V: Kind(a), f: LRU<a, V>, +s: U32) -> LRU<a, V>:
171  F{cap, n, head, +tail, free, m, tab, ks, ents, lk} = f
172  F{cap, n, pick(U32.is_eq(tail, 0), H.link(s), head), H.link(s), free, m, tab, ks, ents,
173    set_if(Array.set(U32, Array.set(U32, lk, pidx(s), tail), nidx(s), 0), nidx(H.slot(tail)), H.link(s), U32.is_eq(tail, 0))}

Uses (10)

Used by (2)