summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Hutchinson <jlhutch@gmail.com>2011-07-25 15:07:56 -0500
committerJay Hutchinson <jlhutch@gmail.com>2011-07-25 15:07:56 -0500
commit8aeb1698716be98fbd6f6ec433c531358becce08 (patch)
treef04e28c62f7045ee4bcec2ce3737ac30bc1386a7
parent578c0ac4cbc434d89554312f28153ae109fd1d96 (diff)
downloadpylru-8aeb1698716be98fbd6f6ec433c531358becce08.tar.gz
Tweaked two lines in pylru.py
-rw-r--r--pylru.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pylru.py b/pylru.py
index cb98b4a..3de5cb0 100644
--- a/pylru.py
+++ b/pylru.py
@@ -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: