Commit 4d2e469c authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ba3b3860
...@@ -498,21 +498,19 @@ def AllStructs(keys, maxdepth, maxsplit, allowEmptyBuckets=False): # -> i[] of T ...@@ -498,21 +498,19 @@ def AllStructs(keys, maxdepth, maxsplit, allowEmptyBuckets=False): # -> i[] of T
keyv.sort() keyv.sort()
# initial [lo, hi) covering keys and such that split points will be there withing +-1 of min/max key # initial [lo, hi) covering keys and such that split points will be there withing +-1 of min/max key
#klo = -inf
#khi = +inf
if len(keyv) > 0: if len(keyv) > 0:
klo = keyv[0] - 1 - 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)
klo = 0
khi = 0
# the only possible case for empty tree is T/B # the only possible case for empty tree is T/B
if not allowEmptyBuckets: if not allowEmptyBuckets:
yield Tree([], Bucket()) yield Tree([], Bucket())
return return
# XXX ok? (should be -inf,+inf)
klo = 0
khi = 0
for tree in _allStructs(klo, khi, keyv, maxdepth, maxsplit, allowEmptyBuckets): for tree in _allStructs(klo, khi, keyv, maxdepth, maxsplit, allowEmptyBuckets):
yield tree yield tree
......
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