addValue method
Adding a value to the memory with an expired time.
key
The key.
value
The value.
expired
The expired time. The unit is ms.
Implementation
void addValue(String key, String value, int expired) {
if (orderList.length >= maxCacheSize) {
_removeOldest();
}
orderList.add(key);
store[key] = (value: value, expired: expired);
}