Commit eacfbbb5 authored by bescoto's avatar bescoto

Possibly fixed logic error in rf caching


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@454 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 9ea115f4
...@@ -308,11 +308,15 @@ class CachedRF: ...@@ -308,11 +308,15 @@ class CachedRF:
while 1: while 1:
if not self.rf_list: if not self.rf_list:
if not self.add_rfs(index): return None if not self.add_rfs(index): return None
rf = self.rf_list.pop(0) rf = self.rf_list[0]
if rf.index < index: continue if rf.index == index: return rf
elif rf.index == index: return rf elif rf.index > index:
self.rf_list.insert(0, rf) # Try to add earlier indicies. But if first is
if not self.add_rfs(index): return None # already from same directory, or we can't find any
# from that directory, then we know it can't be added.
if (index[:-1] == rf.index[:-1] or not
self.add_rfs(index)): return None
else: del self.rf_list[0]
def get_fp(self, index): def get_fp(self, index):
"""Return the file object (for reading) of given index""" """Return the file object (for reading) of given index"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment