public int DeleteExpired(MemBlock key) {
LinkedList<Entry> data = (LinkedList<Entry>) _data[key];
if(data == null) {
return 0;
}
DateTime now = DateTime.UtcNow;
LinkedListNode<Entry> current = data.First;
while(current != null) {
if (current.Value.EndTime > now) {
break;
}
LinkedListNode<Entry> next = current.Next;
data.Remove(current);
current = next;
count--;
}
int lcount = data.Count;
if(data.Count == 0) {
list_of_keys.Remove(key);
_data.Remove(key);
}
return lcount;
}