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
78ca2fad
Commit
78ca2fad
authored
Jun 15, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
eaced681
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
wcfs/internal/xbtree/pptreesubset.go
wcfs/internal/xbtree/pptreesubset.go
+2
-2
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+4
-0
No files found.
wcfs/internal/xbtree/pptreesubset.go
View file @
78ca2fad
...
@@ -141,7 +141,7 @@ func (S PPTreeSubSet) AddPath(path []zodb.Oid) {
...
@@ -141,7 +141,7 @@ func (S PPTreeSubSet) AddPath(path []zodb.Oid) {
// Union returns U = PP(A.leafs | B.leafs)
// Union returns U = PP(A.leafs | B.leafs)
//
//
// In other words it
returns sum of A and B
.
// In other words it
adds A and B nodes
.
func
(
A
PPTreeSubSet
)
Union
(
B
PPTreeSubSet
)
PPTreeSubSet
{
func
(
A
PPTreeSubSet
)
Union
(
B
PPTreeSubSet
)
PPTreeSubSet
{
U
:=
A
.
Clone
()
U
:=
A
.
Clone
()
U
.
UnionInplace
(
B
)
U
.
UnionInplace
(
B
)
...
@@ -168,7 +168,7 @@ func (A PPTreeSubSet) UnionInplace(B PPTreeSubSet) {
...
@@ -168,7 +168,7 @@ func (A PPTreeSubSet) UnionInplace(B PPTreeSubSet) {
// Difference returns D = PP(A.leafs \ B.leafs)
// Difference returns D = PP(A.leafs \ B.leafs)
//
//
// In other words
... XXX
// In other words
it removes B nodes from A while still maintaining A as PP-connected.
func
(
A
PPTreeSubSet
)
Difference
(
B
PPTreeSubSet
)
PPTreeSubSet
{
func
(
A
PPTreeSubSet
)
Difference
(
B
PPTreeSubSet
)
PPTreeSubSet
{
D
:=
A
.
Clone
()
D
:=
A
.
Clone
()
D
.
DifferenceInplace
(
B
)
D
.
DifferenceInplace
(
B
)
...
...
wcfs/internal/xbtree/δbtail.go
View file @
78ca2fad
...
@@ -251,9 +251,12 @@ func (δBtail *ΔBtail) track(key Key, path []zodb.Oid) error {
...
@@ -251,9 +251,12 @@ func (δBtail *ΔBtail) track(key Key, path []zodb.Oid) error {
root
:=
path
[
0
]
root
:=
path
[
0
]
// XXX first normalize path
// nothing to do if key is already tracked
// nothing to do if key is already tracked
leaf
:=
path
[
len
(
path
)
-
1
]
leaf
:=
path
[
len
(
path
)
-
1
]
if
δBtail
.
trackSet
.
Has
(
leaf
)
{
if
δBtail
.
trackSet
.
Has
(
leaf
)
{
tracefΔBtail
(
"->T: nop
\n
"
)
path_
:=
δBtail
.
trackSet
.
Path
(
leaf
)
path_
:=
δBtail
.
trackSet
.
Path
(
leaf
)
if
!
pathEqual
(
path
,
path_
)
{
if
!
pathEqual
(
path
,
path_
)
{
panicf
(
"BUG: key %s is already tracked via path=%v
\n
track requests path=%v"
,
kstr
(
key
),
path_
,
path
)
panicf
(
"BUG: key %s is already tracked via path=%v
\n
track requests path=%v"
,
kstr
(
key
),
path_
,
path
)
...
@@ -270,6 +273,7 @@ func (δBtail *ΔBtail) track(key Key, path []zodb.Oid) error {
...
@@ -270,6 +273,7 @@ func (δBtail *ΔBtail) track(key Key, path []zodb.Oid) error {
δBtail
.
trackNewRoots
.
Add
(
root
)
δBtail
.
trackNewRoots
.
Add
(
root
)
δTtail
.
trackNew
.
AddPath
(
path
)
δTtail
.
trackNew
.
AddPath
(
path
)
tracefΔBtail
(
"->T: [%s].trackNew -> %s
\n
"
,
root
,
δTtail
.
trackNew
)
return
nil
return
nil
}
}
...
...
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