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
3604f4a5
Commit
3604f4a5
authored
May 15, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e1f69447
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
wcfs/pptreesubset.go
wcfs/pptreesubset.go
+15
-14
No files found.
wcfs/pptreesubset.go
View file @
3604f4a5
...
...
@@ -126,19 +126,7 @@ func (S PPTreeSubSet) Path(oid zodb.Oid) (path []zodb.Oid) {
return
path
}
// XXX doc
func
(
S
PPTreeSubSet
)
AddNodePath
(
path
[]
Node
)
{
// XXX Tree|Bucket; path[0] = root
// XXX assert Tree Tree ... Tree Bucket
// root := path[0].(*Tree).POid()
oidv
:=
[]
zodb
.
Oid
{}
for
_
,
node
:=
range
path
{
oidv
=
append
(
oidv
,
node
.
POid
())
}
S
.
AddPath
(
oidv
)
}
// XXX doc
// AddPath adds path to a node to the set.
func
(
S
PPTreeSubSet
)
AddPath
(
path
[]
zodb
.
Oid
)
{
S
.
verify
()
defer
S
.
verify
()
...
...
@@ -176,7 +164,7 @@ func (S PPTreeSubSet) AddPath(path []zodb.Oid) {
// XXX .trackNew += oid
}
if
track
.
parent
!=
parent
{
// XXX -> error (e.g. due to corrupt data in ZODB)
// XXX -> error (e.g. due to corrupt data in ZODB)
?
panicf
(
"node %s is reachable from multiple parents: %s %s"
,
oid
,
track
.
parent
,
parent
)
}
...
...
@@ -190,6 +178,19 @@ func (S PPTreeSubSet) AddPath(path []zodb.Oid) {
}
}
// AddNodePath is a convenience wrapper to call AddPath starting from Nodes instead of Oids.
func
(
S
PPTreeSubSet
)
AddNodePath
(
path
[]
Node
)
{
// XXX Tree|Bucket; path[0] = root
// XXX assert Tree Tree ... Tree Bucket
// root := path[0].(*Tree).POid()
oidv
:=
[]
zodb
.
Oid
{}
for
_
,
node
:=
range
path
{
oidv
=
append
(
oidv
,
node
.
POid
())
}
S
.
AddPath
(
oidv
)
}
// ---- Union/Difference ----
...
...
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