diff options
author | Jay Hutchinson <jlhutch@gmail.com> | 2011-07-25 15:07:56 -0500 |
---|---|---|
committer | Jay Hutchinson <jlhutch@gmail.com> | 2011-07-25 15:07:56 -0500 |
commit | 8aeb1698716be98fbd6f6ec433c531358becce08 (patch) | |
tree | f04e28c62f7045ee4bcec2ce3737ac30bc1386a7 | |
parent | 578c0ac4cbc434d89554312f28153ae109fd1d96 (diff) | |
download | pylru-8aeb1698716be98fbd6f6ec433c531358becce08.tar.gz |
Tweaked two lines in pylru.py
-rw-r--r-- | pylru.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -43,7 +43,8 @@ class lrucache(object): def __init__(self, size, callback=None): self.callback = callback - # Initialize the hash table as empty. + + # Create an empty hash table. self.table = {} # Initialize the doubly linked list with one empty node. This is an @@ -233,7 +234,7 @@ class lrucache(object): # Decreases the size of the list by removing n nodes from the tail of the # list. def removeTailNode(self, n): - assert self.listSize > 1 # Invarient. XXX REMOVE this line XXX + assert self.listSize > n for i in range(n): node = self.head.prev if not node.empty: |