Skip to content

Commit

Permalink
simplifies case statement.
Browse files Browse the repository at this point in the history
  • Loading branch information
refefer committed Jun 20, 2012
1 parent bbf4bd4 commit 047022d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/simple_cache.erl
Expand Up @@ -117,15 +117,12 @@ clean_expired(Table, Heap, CurrentTime) ->
% Grab the key
case ets:lookup(Table, Key) of
% We need to check that the Expiration date hasn't been updated
%to a later time.
% to a later time.
[{Key, _Value, RealExpires}] when RealExpires =< CurrentTime ->
ets:delete(Table, Key);

% Item has expired
[_Item] -> ok;

% Key is no longer in the table or hasn't expired, move along.
[] -> ok
_Other -> ok
end,
{ok, NewHeap} = pairheap:delete_min(Heap),
clean_expired(Table, NewHeap);
Expand Down

0 comments on commit 047022d

Please sign in to comment.