Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
d1f27435
Commit
d1f27435
authored
May 18, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
846e08c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
wcfs/internal/xbtree.py
wcfs/internal/xbtree.py
+10
-5
No files found.
wcfs/internal/xbtree.py
View file @
d1f27435
...
...
@@ -506,7 +506,12 @@ def _allStructs(klo, khi, keyv, maxdepth, maxsplit, allowEmptyBuckets):
# (klo, khi, keyv, maxdepth, maxsplit))
for
nsplit
in
range
(
0
,
maxsplit
+
1
):
for
ksplitv
in
_iterSplitByN
(
klo
,
khi
,
nsplit
):
if
not
allowEmptyBuckets
:
iksplitv
=
_iterSplitKeyvByN
(
klo
,
khi
,
keyv
,
nsplit
)
else
:
iksplitv
=
_iterSplitByN
(
klo
,
khi
,
nsplit
)
for
ksplitv
in
iksplitv
:
# ksplitv = [klo, s1, s2, ..., sN, khi]
#print('ksplitv: %r' % ksplitv)
...
...
@@ -514,8 +519,8 @@ def _allStructs(klo, khi, keyv, maxdepth, maxsplit, allowEmptyBuckets):
children
=
[]
for
(
xlo
,
xhi
)
in
zip
(
ksplitv
[:
-
1
],
ksplitv
[
1
:]):
# (klo, s1), (s1, s2), ..., (sN, khi)
bkeyv
=
_keyvSliceBy
(
keyv
,
xlo
,
xhi
)
if
len
(
bkeyv
)
==
0
and
(
not
allowEmptyBuckets
)
:
break
if
not
allowEmptyBuckets
:
assert
len
(
bkeyv
)
>
0
children
.
append
(
Bucket
(
*
bkeyv
))
else
:
yield
Tree
(
ksplitv
[
1
:
-
1
],
*
children
)
# (s1, s2, ..., sN)
...
...
@@ -526,8 +531,8 @@ def _allStructs(klo, khi, keyv, maxdepth, maxsplit, allowEmptyBuckets):
ichildrenv
=
[]
# of _allStructs for each child link
for
(
xlo
,
xhi
)
in
zip
(
ksplitv
[:
-
1
],
ksplitv
[
1
:]):
# (klo, s1), (s1, s2), ..., (sN, khi)
ckeyv
=
_keyvSliceBy
(
keyv
,
xlo
,
xhi
)
if
len
(
ckeyv
)
==
0
and
(
not
allowEmptyBuckets
)
:
break
if
not
allowEmptyBuckets
:
assert
len
(
ckeyv
)
>
0
ichildrenv
.
append
(
_allStructs
(
xlo
,
xhi
,
ckeyv
,
maxdepth
-
1
,
maxsplit
,
allowEmptyBuckets
))
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment