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
e5aef07a
Commit
e5aef07a
authored
May 12, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
1cbf4b33
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
wcfs/internal/xbtree.py
wcfs/internal/xbtree.py
+18
-7
No files found.
wcfs/internal/xbtree.py
View file @
e5aef07a
...
...
@@ -288,14 +288,18 @@ def Restructure(ztree, newStructure):
# extract bucket nodes.
zrbucketv
=
[]
# of _NodeInRange
rbucketv
=
[]
# of _NodeInRange
while
len
(
rlevelv
)
>
0
:
rlevel
=
rlevelv
.
pop
(
0
)
while
len
(
rlevelv
)
>
0
or
len
(
zrlevelv
)
>
0
:
if
len
(
rlevelv
)
==
0
:
rlevel
=
[]
else
:
rlevel
=
rlevelv
.
pop
(
0
)
if
len
(
zrlevelv
)
==
0
:
zrlevel
=
[]
else
:
zrlevel
=
zrlevelv
.
pop
(
0
)
# filter-out buckets
# filter-out buckets
to be processed in the end
_
=
[]
# zrlevel -> zrlevel, zrbucketv
for
zrn
in
zrlevel
:
assert
isinstance
(
zrn
.
node
,
(
ztreeType
,
zbucketType
))
...
...
@@ -313,16 +317,21 @@ def Restructure(ztree, newStructure):
_
.
append
(
rn
)
rlevel
=
_
if
len
(
rlevel
)
==
0
:
continue
# associate nodes to znodes
assign
(
zrlevel
,
rlevel
)
"""
if len(zrlevel) == len(rlevel): # map 1-1
for (zrn, rn) in zip(zrlevel, rlevel):
rn.node.Z = zrn.node
else:
panic("TODO")
"""
if
len
(
zrlevelv
)
>
0
:
panic
(
"TODO"
)
assert
zrlevelv
==
[]
assert
rlevelv
==
[]
# order queued buckets and zbuckets by key↑
zrbucketv
.
sort
(
key
=
lambda
rn
:
rn
.
range
.
klo
)
...
...
@@ -336,12 +345,14 @@ def Restructure(ztree, newStructure):
rbucketv
[
-
1
].
node
.
next_bucket
=
None
# associate every bucket to zbucket
assign
(
zrbucketv
,
rbucketv
)
"""
if len(zrbucketv) == len(rbucketv):
for (zrbucket, rbucket) in zip(zrbucketv, rbucketv):
rbucket.node.Z = zrbucket.node
else:
panic("TODO")
"""
# set znode states according to established tnew->znode association
...
...
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