Commit cc06d445 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a3c0e825
......@@ -140,6 +140,16 @@ class Tree(object):
def copy(t):
return Tree(t.keyv, *[_.copy() for _ in t.children])
# firstbucket returns Bucket reachable through leftmost child links.
def firstbucket(t):
child0 = t.children[0]
if isinstance(child0, Bucket):
return child0
assert isinstance(child0, Tree)
return child0.firstbucket()
# Bucket represents a bucket node.
class Bucket(object):
......@@ -394,7 +404,7 @@ def Restructure(ztree, newStructure):
zstate = (zstate,)
# firstbucket
zstate += (None,) # XXX
zstate += (node.firstbucket().Z,)
# https://github.com/zopefoundation/BTrees/blob/4.5.0-1-gc8bf24e/BTrees/BucketTemplate.c#L1195
if isinstance(node, Bucket):
......
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