Skip to content

Instantly share code, notes, and snippets.

@einarwh
Created February 28, 2013 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save einarwh/5055385 to your computer and use it in GitHub Desktop.
Save einarwh/5055385 to your computer and use it in GitHub Desktop.
Prune method.
private void Prune()
{
DateTime expirationTime = DateTime.Now - _lifetime;
while (true)
{
var node = _list.Last;
if (node == null || node.Value.Value.TimeStamp > expirationTime)
{
return;
}
_list.RemoveLast();
_dict.Remove(node.Value.Key);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment