Commit 10c717d3 authored by Vincent Pelletier's avatar Vincent Pelletier Committed by Sebastien Robin

Drop unused/redundant locals.

parent 1bf1db53
...@@ -36,10 +36,9 @@ class BTreeData(Persistent): ...@@ -36,10 +36,9 @@ class BTreeData(Persistent):
assert lower_key == offset, (lower_key, offset) assert lower_key == offset, (lower_key, offset)
key = lower_key key = lower_key
buf_offset = 0 buf_offset = 0
actual_buf_len = len(buf)
to_apply = {} to_apply = {}
for next_key in tree.iterkeys(key): for next_key in tree.iterkeys(key):
if buf_offset >= actual_buf_len: if buf_offset >= buf_len:
break break
next_buf_offset = buf_offset + (next_key - key) next_buf_offset = buf_offset + (next_key - key)
to_apply[key] = PersistentString(buf[buf_offset:next_buf_offset]) to_apply[key] = PersistentString(buf[buf_offset:next_buf_offset])
...@@ -63,11 +62,9 @@ class BTreeData(Persistent): ...@@ -63,11 +62,9 @@ class BTreeData(Persistent):
except ValueError: except ValueError:
return '' return ''
else: else:
last_key = key
iterator = tree.iterkeys(key)
offset -= key offset -= key
written = 0 written = 0
for key in iterator: for key in tree.iterkeys(key):
padding = min(size, key - start_offset - written) padding = min(size, key - start_offset - written)
if padding: if padding:
write('\x00' * padding) write('\x00' * padding)
...@@ -83,7 +80,6 @@ class BTreeData(Persistent): ...@@ -83,7 +80,6 @@ class BTreeData(Persistent):
size -= to_write_len size -= to_write_len
written += to_write_len written += to_write_len
offset = 0 offset = 0
last_key = key
return result.getvalue() return result.getvalue()
def truncate(self, offset): def truncate(self, offset):
......
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