Open TysonAndre opened 2 years ago
new LRUCache(?int $maxSize = null)
$cache->getOrCreate(mixed $key, callable $create)
Adding getOrCreate($key, callable $callback) to Map seems easier.
getOrCreate($key, callable $callback)
Map
Tracking start HashPosition would avoid this worst-case performance in maps in general (update on iteration)
start
HashPosition
new LRUCache(?int $maxSize = null)
$cache->getOrCreate(mixed $key, callable $create)