Commit 88d82e3a authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent fdad8f42
...@@ -147,18 +147,17 @@ def IterAllStructs(keys, maxdepth, maxsplit): ...@@ -147,18 +147,17 @@ def IterAllStructs(keys, maxdepth, maxsplit):
keyv = list(keys) keyv = list(keys)
keyv.sort() keyv.sort()
# initial [lo, hi) covering keys with +-1 # initial [lo, hi) covering keys and such that split points will be there withing +-1 of min/max key
#klo = -inf #klo = -inf
#khi = +inf #khi = +inf
if len(keyv) > 0: if len(keyv) > 0:
klo = keyv[0] - 1 klo = keyv[0] - 1 - 1
khi = keyv[-1] + 1 + 1 # hi is ")", not "]" khi = keyv[-1] + 1 + 1 # hi is ")", not "]"
else: else:
# XXX ok? (should be -inf,+inf) # XXX ok? (should be -inf,+inf)
klo = 0 klo = 0
khi = 0 khi = 0
for tree in _iterAllStructs(klo, khi, keyv, maxdepth, maxsplit): for tree in _iterAllStructs(klo, khi, keyv, maxdepth, maxsplit):
yield tree yield tree
......
...@@ -101,8 +101,11 @@ def test_iterAllStructs(): ...@@ -101,8 +101,11 @@ def test_iterAllStructs():
assert X([1,3], 0, 0) == [ T([], B(1,3)) ] assert X([1,3], 0, 0) == [ T([], B(1,3)) ]
print('\n\nAAA\n\n') print('\n\nAAA\n\n')
assert X([1,3], 0, 1) == [ T([], B(1,3)), assert X([1,3], 0, 1) == [ T([], B(1,3)),
T([0], B()), T([0], B(), B(1,3)),
# XXX T([1], B(), B(1,3)),
T([2], B(1), B(3)),
T([3], B(1), B(3)),
T([4], B(1,3), B()),
] ]
......
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