Skip to content
Permalink
Browse files

structure this code better

  • Loading branch information
Alex Gaynor
Alex Gaynor committed Apr 12, 2013
1 parent 3c47cad commit 2dad17882122677a01adee12f526e75c16cc59d2
Showing with 4 additions and 1 deletion.
  1. +4 −1 topaz/mapdict.py
@@ -49,7 +49,10 @@ def update_storage_size(self, w_obj, node):
self._size_estimate = size_est
if node.length() > self.length():
# note that node.size_estimate() is always at least node.length()
new_storage = [None] * max(node.size_estimate(), len(w_obj.storage) if w_obj.storage else 0)
new_size = node.size_estimate()
if w_obj.storage:
new_size = max(new_size, len(w_obj.storage))
new_storage = [None] * new_size
if w_obj.storage:
new_storage[:len(w_obj.storage)] = w_obj.storage
w_obj.storage = new_storage

0 comments on commit 2dad178

Please sign in to comment.