Releases: pqwy/lru
Releases · pqwy/lru
0.3.1
v0.3.0
CHANGES:
Semantics cleanup.
Breaking:
find
drops?promote
and never changes the ordering.add
drops?trim
and never drops bindings.size
->weight
items
->size
unadd
->pop
F.S.fold
andF.S.iter
iterate in LRU order.F.M.fold
andF.M.iter
drop?dir
and always iterate in LRU order.
Other:
- add
F.S.fold_k
andF.S.iter_k
To fix client code:
- replace
find ~promote:false
withfind
; - replace
find
andfind ~promote:true
withfind
andpromote
; - replace
add ~trim:false
withadd
; - replace
add
andadd ~trim:true
withadd
andtrim
; s/size/weight/g
,s/items/size/g
,s/unadd/pop/g
;- audit uses of
fold
anditer
for order-sensitivity.
v0.2.0
v0.2.0 2017-03-31
Breaking changes:
-
resize
no longer drops bindings if the new size pushes the queue over capacity. -
of_list
has simpler semantics; dropped thecap
parameter.
Other changes:
-
Replace
Lru.M.cache
with more generalLru.memo
. -
Queues with 0 initial capacity are legal.
-
Add
trim
to shrink a queue to its capacity, as queues are no longer guaranteed to
have size smaller than capacity. -
find
gets thepromote
parameter, allowing queries that do not change the order. -
add
gets thetrim
parameter, allowing insertions that do not drop old entries.