Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
structure this code better
- Loading branch information
Showing
with
4 additions
and
1 deletion.
-
+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 |
|
|