template rightSize(cap): untyped {.dirty.}=
when declared(tables.rightSize)and(NimMajor,NimMinor)<(1,4):
tables.rightSize(cap)
else:
cap
proc newLruCache*[K,T](capacity: int): LruCache[K,T] =
## Create a new Least-Recently-Used (LRU) cache that store the last
`capacity`-accessed items.
LruCache[K,T](
capacity: capacity,
list: initDoublyLinkedList[Node[K,T]](),
table: initTable[K, DoublyLinkedNode[Node[K,T]]]( rightSize(capacity) )
)
Run
- How to avoid deprecation notice for libraies supporting multi... jackhftang
- How to avoid deprecation notice for libraies supporting ... leorize
- How to avoid deprecation notice for libraies support... jackhftang
- How to avoid deprecation notice for libraies sup... leorize
- How to avoid deprecation notice for libraies... Araq
- How to avoid deprecation notice for lib... leorize
- How to avoid deprecation notice for... cblake
- How to avoid deprecation notice... cblake
- How to avoid deprecation notice... shirleyquirk
- How to avoid deprecation notice... jackhftang
- How to avoid deprecation notice... jackhftang
- How to avoid deprecation notice... shirleyquirk
- How to avoid deprecation notice... jackhftang
- How to avoid deprecation notice... Yardanico
- How to avoid deprecation notice... jackhftang
- How to avoid deprecation notice... shirleyquirk
- How to avoid deprecation notice... jackhftang
