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
21f3692b
Commit
21f3692b
authored
May 15, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c21de4a4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
wcfs/δbtail.go
wcfs/δbtail.go
+18
-5
No files found.
wcfs/δbtail.go
View file @
21f3692b
...
...
@@ -441,19 +441,32 @@ func (δBtail *ΔBtail) rebuild() (err error) {
δBtail
.
byRoot
[
root
]
=
δTtail
}
// δTtail.vδT[i] <- merge δT*
δTi
:=
δTtail
.
vδT
[
i
]
// δTtail.vδT <- merge δT*
l
:=
len
(
δTtail
.
vδT
)
j
:=
sort
.
Search
(
l
,
func
(
k
int
)
bool
{
return
δZ
.
Rev
<=
δTtail
.
vδT
[
k
]
.
Rev
})
if
j
==
l
||
δTtail
.
vδT
[
j
]
.
Rev
!=
δZ
.
Rev
{
δTcurr
:=
ΔTree
{
Rev
:
δZ
.
Rev
,
ΔKV
:
map
[
Key
]
ΔValue
{}}
// insert(@j, δTcurr)
δTtail
.
vδT
=
append
(
δTtail
.
vδT
[
:
j
],
append
([]
ΔTree
{
δTcurr
},
δTtail
.
vδT
[
j
:
]
...
)
...
)
}
δTcurr
:=
δTtail
.
vδT
[
j
]
for
k
,
δv
:=
range
δT
{
// the diff was backward; δTtail entries are with diff forward
δv
.
New
,
δv
.
Old
=
δv
.
Old
,
δv
.
New
δv_
,
already
:=
δT
i
.
ΔKV
[
k
]
δv_
,
already
:=
δT
curr
.
ΔKV
[
k
]
if
already
{
if
δv
!=
δv_
{
panicf
(
"[%v] inconsistent δv:
\n
δT
i: %v
\n
δT: %v"
,
k
,
δTi
,
δT
)
panicf
(
"[%v] inconsistent δv:
\n
δT
curr: %v
\n
δT: %v"
,
k
,
δTcurr
,
δT
)
}
}
else
{
δT
i
.
ΔKV
[
k
]
=
δv
δT
curr
.
ΔKV
[
k
]
=
δv
}
}
...
...
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