LRUCache<K, V> constructor

LRUCache<K, V>(
  1. int capacity
)

Creates an LRU cache that holds at most capacity entries.

Throws an ArgumentError if capacity is not a positive integer.

Implementation

LRUCache(this.capacity) {
  if (capacity <= 0) {
    throw ArgumentError.value(capacity, 'capacity', 'must be positive');
  }
}