Commit c6785679 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 3e55a643
......@@ -371,6 +371,15 @@ def Restructure(ztree, newStructure):
zrbucketv.sort(key = lambda rn: rn.range.klo)
rbucketv .sort(key = lambda rn: rn.range.klo)
# verify that old keys == new keys
zkeys = set()
keys = set()
for _ in zrbucketv: zkeys.update(_.node.keys())
for _ in rbucketv: keys.update(_.node.keyv)
assert set(kv.keys()) == zkeys
if zkeys != keys:
raise ValueError("new keys != old keys\ndiff: %s" % zkeys.symmetric_difference(keys))
# chain buckets via .next_bucket
assert len(rbucketv) > 0
for i in range(len(rbucketv)-1):
......
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