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
c21de4a4
Commit
c21de4a4
authored
May 15, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
d2bb8d78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
30 deletions
+3
-30
wcfs/δbtail.go
wcfs/δbtail.go
+3
-30
No files found.
wcfs/δbtail.go
View file @
c21de4a4
...
...
@@ -293,7 +293,6 @@ func (orig *ΔBtail) clone() *ΔBtail {
return
klon
}
/*
// newΔTtail creates new empty ΔTtail object.
func
newΔTtail
()
*
ΔTtail
{
return
&
ΔTtail
{
...
...
@@ -301,7 +300,6 @@ func newΔTtail() *ΔTtail {
lastRevOf
:
make
(
map
[
Key
]
zodb
.
Tid
),
}
}
*/
// (tail, head] coverage
func
(
δBtail
*
ΔBtail
)
Head
()
zodb
.
Tid
{
return
δBtail
.
δZtail
.
Head
()
}
...
...
@@ -325,7 +323,7 @@ func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() }
//
// XXX catch cycles on add?
func
(
δBtail
*
ΔBtail
)
Track
(
key
Key
,
keyPresent
bool
,
path
[]
Node
)
error
{
// XXX Tree|Bucket; path[0] = root
// XXX assert Tree Tree ... Tree Bucket
// XXX assert Tree Tree ... Tree Bucket
XXX AddNodePath does that
root
:=
path
[
0
]
.
(
*
Tree
)
.
POid
()
pathv
:=
[]
string
{}
...
...
@@ -352,12 +350,6 @@ func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node) error { //
}
}
/*
_, ok := δBtail.byRoot[root]
if !ok {
δBtail.byRoot[root] = newΔTtail()
}
*/
// XXX update diff XXX here? or as separate step?
// XXX update lastRevOf
...
...
@@ -445,16 +437,7 @@ func (δBtail *ΔBtail) rebuild() (err error) {
δTtail
,
ok
:=
δBtail
.
byRoot
[
root
]
if
!
ok
{
// this root was not tracked before -> create δTtail for it with empty changes
// XXX do not keep entries with empty δkv ?
var
vδT
[]
ΔTree
for
_
,
δZj
:=
range
vδZ
{
vδT
=
append
(
vδT
,
ΔTree
{
Rev
:
δZj
.
Rev
,
ΔKV
:
make
(
map
[
Key
]
ΔValue
)})
}
δTtail
=
&
ΔTtail
{
vδT
:
vδT
,
// XXX KVAtTail: ...,
// XXX lastRevOf: ...,
}
δTtail
=
newΔTtail
()
δBtail
.
byRoot
[
root
]
=
δTtail
}
...
...
@@ -550,17 +533,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
δTtail
,
ok
:=
δBtail
.
byRoot
[
root
]
if
!
ok
{
// this root was not tracked before -> create δTtail for it with empty changes
// XXX do not keep entries with empty δkv ?
var
vδT
[]
ΔTree
vδZ
:=
δBtail
.
δZtail
.
Data
()
for
_
,
δZj
:=
range
vδZ
[
:
len
(
vδZ
)
-
1
]
{
vδT
=
append
(
vδT
,
ΔTree
{
Rev
:
δZj
.
Rev
,
ΔKV
:
make
(
map
[
Key
]
ΔValue
)})
}
δTtail
=
&
ΔTtail
{
vδT
:
vδT
,
// XXX KVAtTail: ...,
// XXX lastRevOf: ...,
}
δTtail
=
newΔTtail
()
δBtail
.
byRoot
[
root
]
=
δTtail
}
...
...
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