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
34fda4fd
Commit
34fda4fd
authored
Jun 07, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
d3f4a457
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
wcfs/internal/xbtree/treediff.go
wcfs/internal/xbtree/treediff.go
+1
-1
wcfs/internal/xbtree/δbtail_test.go
wcfs/internal/xbtree/δbtail_test.go
+15
-8
No files found.
wcfs/internal/xbtree/treediff.go
View file @
34fda4fd
...
...
@@ -797,7 +797,7 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackSet PPTreeSubSet)
/*
// continue with next right bucket until r coverage is complete
lo = a.hi_ + 1
if r.hi_ <
=
lo {
if r.hi_ < lo {
break
}
*/
...
...
wcfs/internal/xbtree/δbtail_test.go
View file @
34fda4fd
...
...
@@ -616,6 +616,10 @@ func _KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) {
panic
(
"multiple key sets on the call"
)
}
tracef
(
"
\n\n
_KAdj
\n
"
)
tracef
(
"t1: %s
\n
"
,
t1
.
tree
)
tracef
(
"t2: %s
\n
"
,
t2
.
tree
)
tracef
(
"keys: %s
\n
"
,
keys
)
// kadj = {} k -> adjacent keys.
// if k is tracked -> changes to adjacents must be in Update(t1->t2).
...
...
@@ -629,14 +633,15 @@ func _KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) {
done1
:=
&
RangedKeySet
{}
done2
:=
&
RangedKeySet
{}
//tracef("\n"
)
tracef
(
"
\n
k%d
\n
"
,
k
)
for
!
q1
.
Empty
()
||
!
q2
.
Empty
()
{
//tracef("q1: %v\n", q
1)
//tracef("q2: %v\n", q
2)
tracef
(
"q1: %s
\t
done1: %s
\n
"
,
q1
,
done
1
)
tracef
(
"q2: %s
\t
done2: %s
\n
"
,
q2
,
done
2
)
for
_
,
r1
:=
range
q1
.
AllRanges
()
{
lo1
:=
r1
.
lo
for
{
b1
:=
t1
.
xkv
.
Get
(
lo1
)
tracef
(
" b1: %s
\n
"
,
b1
)
for
k_
:=
range
keys
{
if
b1
.
lo
<=
k_
&&
k_
<=
b1
.
hi_
{
adj1
.
Add
(
k_
)
...
...
@@ -649,10 +654,11 @@ func _KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) {
δq2
.
AddRange
(
b1r
)
δq2
.
DifferenceInplace
(
done2
)
q2
.
UnionInplace
(
δq2
)
tracef
(
"q2 += %s
\t
-> %s
\n
"
,
δq2
,
q2
)
// continue with next right bucket until r1 coverage is complete
lo1
=
b1
.
hi_
+
1
if
r1
.
hi_
<
=
lo1
{
if
r1
.
hi_
<
lo1
{
break
}
}
...
...
@@ -663,6 +669,7 @@ func _KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) {
lo2
:=
r2
.
lo
for
{
b2
:=
t2
.
xkv
.
Get
(
lo2
)
tracef
(
" b2: %s
\n
"
,
b2
)
for
k_
:=
range
keys
{
if
b2
.
lo
<=
k_
&&
k_
<=
b2
.
hi_
{
adj2
.
Add
(
k_
)
...
...
@@ -675,10 +682,11 @@ func _KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) {
δq1
.
AddRange
(
b2r
)
δq1
.
DifferenceInplace
(
done1
)
q1
.
UnionInplace
(
δq1
)
tracef
(
"q1 += %s
\t
-> %s
\n
"
,
δq1
,
q1
)
// continue with next right bucket until r2 coverage is complete
lo2
=
b2
.
hi_
+
1
if
r2
.
hi_
<
=
lo2
{
if
r2
.
hi_
<
lo2
{
break
}
}
...
...
@@ -1447,7 +1455,7 @@ func TestΔBTail(t *testing.T) {
// test known cases going through tree1 -> tree2 -> ...
testv
:=
[]
interface
{}
{
/
//
*
/*
// start from non-empty tree to verify both ->empty and empty-> transitions
"T/B1:a,2:b",
...
...
@@ -1470,7 +1478,6 @@ func TestΔBTail(t *testing.T) {
A{1: K(1,2,oo),
2: K(1,2,oo),
oo: K(1,2,oo)}),
//*/
// 2: b->c
Δ("T/B2:c",
...
...
@@ -1508,7 +1515,7 @@ func TestΔBTail(t *testing.T) {
4: K(1,2,3,4,5,oo),
5: K(1,2,3,4,5,oo),
oo: K(1,2,3,4,5,oo)}),
*/
// reflow of keys: even if tracked={1}, changes to all B nodes need to be rescanned:
// +B12 forces to look in -B23 which adds -3 into δ, which
// forces to look into +B34 and so on.
...
...
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