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
08d1b294
Commit
08d1b294
authored
Sep 07, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
719088f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
wcfs/δbtail.go
wcfs/δbtail.go
+17
-5
No files found.
wcfs/δbtail.go
View file @
08d1b294
...
...
@@ -425,6 +425,7 @@ func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node) error { //
}
// XXX place
// XXX doc
func
(
tidx
trackIndex
)
AddPath
(
path
[]
Node
)
{
// XXX Tree|Bucket; path[0] = root
l
:=
len
(
path
)
if
l
==
0
{
...
...
@@ -599,6 +600,16 @@ type nodeInRange struct {
done
bool
// whether this node was already taken into account while computing diff
}
// XXX place, doc
func
(
n
*
nodeInRange
)
NodePath
()
[]
Node
{
path
:=
[]
Node
{}
for
n
!=
nil
{
path
=
append
([]
Node
{
n
.
node
},
path
...
)
n
=
n
.
parent
}
return
path
}
// rangeSplit represents set of nodes covering a range.
// nodes come with key↑ and no intersection in between their [lo,hi)
type
rangeSplit
[]
*
nodeInRange
// key↑
...
...
@@ -664,9 +675,10 @@ func (prs *rangeSplit) Expand(rnode *nodeInRange) (children rangeSplit) {
}
children
=
append
(
children
,
&
nodeInRange
{
lo
:
lo
,
hi_
:
hi_
,
node
:
treev
[
i
]
.
Child
(),
parent
:
rnode
,
lo
:
lo
,
hi_
:
hi_
,
node
:
treev
[
i
]
.
Child
(),
})
}
...
...
@@ -900,8 +912,8 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx trackIndex, h
// initial split ranges for A and B
// XXX maybe walk till a from root to get more precise initial range?
atop
:=
&
nodeInRange
{
lo
:
KeyMin
,
hi_
:
KeyMax
,
node
:
A
}
// [-∞, ∞)
btop
:=
&
nodeInRange
{
lo
:
KeyMin
,
hi_
:
KeyMax
,
node
:
B
}
// [-∞, ∞)
atop
:=
&
nodeInRange
{
lo
:
KeyMin
,
hi_
:
KeyMax
,
node
:
A
}
// [-∞, ∞)
XXX parent?
btop
:=
&
nodeInRange
{
lo
:
KeyMin
,
hi_
:
KeyMax
,
node
:
B
}
// [-∞, ∞)
XXX parent?
Av
:=
rangeSplit
{
atop
}
// nodes expanded from A
Bv
:=
rangeSplit
{
btop
}
// nodes expanded from B
...
...
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