Lru.add_pick: def of bend-collections@1.0.0.0
Import: import bend-collections@1.0.0.0/src/containers/lru.bend as Lru
Lines 401-406 of bend-collections@1.0.0.0/src/containers/lru.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/containers/lru.bend&start_line=401&end_line=406
import Base
import bend-collections@1.0.0.0/src/containers/hash_table.bend as H
def add_pick(a, -V: Kind(a), f: LRU, key: String, +at: U32, +h: U32, +l: U32, e: Ent, absent: Bool) -> LRU & Bool:
match absent:
case False{}:
(replace(a, V, f, H.slot(l), e), False{})
case True{}:
add_full(a, V, f, key, at, h, e)
Uses (10):
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32
https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/hash_table.bend&name=slot
https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/lru.bend&name=Ent
https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/lru.bend&name=LRU
https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/lru.bend&name=add_full
https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/lru.bend&name=replace