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
4c6bd292
Commit
4c6bd292
authored
Jun 07, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c7b5c7e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
wcfs/internal/xbtree/δbtail_test.go
wcfs/internal/xbtree/δbtail_test.go
+17
-17
No files found.
wcfs/internal/xbtree/δbtail_test.go
View file @
4c6bd292
...
...
@@ -606,9 +606,9 @@ func _KAdj_old(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) {
return
kadj
}
const
traceKAdj
=
tru
e
func
trace
fKAdj
(
format
string
,
argv
...
interface
{})
{
if
trace
KAdj
{
const
debugKAdj
=
fals
e
func
debug
fKAdj
(
format
string
,
argv
...
interface
{})
{
if
debug
KAdj
{
fmt
.
Printf
(
format
,
argv
...
)
}
}
...
...
@@ -624,12 +624,12 @@ func _KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) {
panic
(
"multiple key sets on the call"
)
}
trace
fKAdj
(
"
\n\n
_KAdj
\n
"
)
trace
fKAdj
(
"t1: %s
\n
"
,
t1
.
tree
)
trace
fKAdj
(
"t2: %s
\n
"
,
t2
.
tree
)
trace
fKAdj
(
"keys: %s
\n
"
,
keys
)
debug
fKAdj
(
"
\n\n
_KAdj
\n
"
)
debug
fKAdj
(
"t1: %s
\n
"
,
t1
.
tree
)
debug
fKAdj
(
"t2: %s
\n
"
,
t2
.
tree
)
debug
fKAdj
(
"keys: %s
\n
"
,
keys
)
defer
func
()
{
trace
fKAdj
(
"kadj -> %v
\n
"
,
kadj
)
debug
fKAdj
(
"kadj -> %v
\n
"
,
kadj
)
}()
// kadj = {} k -> adjacent keys.
...
...
@@ -644,19 +644,19 @@ func _KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) {
done1
:=
&
RangedKeySet
{}
done2
:=
&
RangedKeySet
{}
trace
fKAdj
(
"
\n
k%s
\n
"
,
kstr
(
k
))
debug
fKAdj
(
"
\n
k%s
\n
"
,
kstr
(
k
))
for
!
q1
.
Empty
()
||
!
q2
.
Empty
()
{
trace
fKAdj
(
"q1: %s
\t
done1: %s
\n
"
,
q1
,
done1
)
trace
fKAdj
(
"q2: %s
\t
done2: %s
\n
"
,
q2
,
done2
)
debug
fKAdj
(
"q1: %s
\t
done1: %s
\n
"
,
q1
,
done1
)
debug
fKAdj
(
"q2: %s
\t
done2: %s
\n
"
,
q2
,
done2
)
for
_
,
r1
:=
range
q1
.
AllRanges
()
{
lo1
:=
r1
.
lo
for
{
b1
:=
t1
.
xkv
.
Get
(
lo1
)
trace
fKAdj
(
" b1: %s
\n
"
,
b1
)
debug
fKAdj
(
" b1: %s
\n
"
,
b1
)
for
k_
:=
range
keys
{
if
b1
.
lo
<=
k_
&&
k_
<=
b1
.
hi_
{
adj1
.
Add
(
k_
)
trace
fKAdj
(
" adj1 += %s
\t
-> %s
\n
"
,
kstr
(
k_
),
adj1
)
debug
fKAdj
(
" adj1 += %s
\t
-> %s
\n
"
,
kstr
(
k_
),
adj1
)
}
}
b1r
:=
KeyRange
{
b1
.
lo
,
b1
.
hi_
}
...
...
@@ -666,7 +666,7 @@ func _KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) {
δq2
.
AddRange
(
b1r
)
δq2
.
DifferenceInplace
(
done2
)
q2
.
UnionInplace
(
δq2
)
trace
fKAdj
(
"q2 += %s
\t
-> %s
\n
"
,
δq2
,
q2
)
debug
fKAdj
(
"q2 += %s
\t
-> %s
\n
"
,
δq2
,
q2
)
// continue with next right bucket until r1 coverage is complete
if
r1
.
hi_
<=
b1
.
hi_
{
...
...
@@ -681,11 +681,11 @@ func _KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) {
lo2
:=
r2
.
lo
for
{
b2
:=
t2
.
xkv
.
Get
(
lo2
)
trace
fKAdj
(
" b2: %s
\n
"
,
b2
)
debug
fKAdj
(
" b2: %s
\n
"
,
b2
)
for
k_
:=
range
keys
{
if
b2
.
lo
<=
k_
&&
k_
<=
b2
.
hi_
{
adj2
.
Add
(
k_
)
trace
fKAdj
(
" adj2 += %s
\t
-> %s
\n
"
,
kstr
(
k_
),
adj2
)
debug
fKAdj
(
" adj2 += %s
\t
-> %s
\n
"
,
kstr
(
k_
),
adj2
)
}
}
b2r
:=
KeyRange
{
b2
.
lo
,
b2
.
hi_
}
...
...
@@ -695,7 +695,7 @@ func _KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) {
δq1
.
AddRange
(
b2r
)
δq1
.
DifferenceInplace
(
done1
)
q1
.
UnionInplace
(
δq1
)
trace
fKAdj
(
"q1 += %s
\t
-> %s
\n
"
,
δq1
,
q1
)
debug
fKAdj
(
"q1 += %s
\t
-> %s
\n
"
,
δq1
,
q1
)
// continue with next right bucket until r2 coverage is complete
if
r2
.
hi_
<=
b2
.
hi_
{
...
...
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