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
2f90a5da
Commit
2f90a5da
authored
May 31, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c9e9d6c7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+31
-0
No files found.
wcfs/δbtail_test.go
View file @
2f90a5da
...
...
@@ -373,3 +373,34 @@ func TestIntSets(t *testing.T) {
t
.
Fatalf
(
"error:
\n
got: %v
\n
want: %v"
,
got
,
want
)
}
}
// kvdiff returns differens in between kv1 and kv2.
var
DEL
=
"ø"
type
kvdelta1
struct
{
k
Key
v
string
// DEL means delete
}
func
kvdiff
(
kv1
,
kv2
map
[
Key
]
string
)
[]
kvdelta1
{
delta
:=
[]
kvdelta1
{}
keys
:=
SetI64
{}
for
k
:=
range
kv1
{
keys
.
Add
(
k
)
}
for
k
:=
range
kv2
{
keys
.
Add
(
k
)
}
keyv
:=
[]
Key
{}
for
k
:=
range
keys
{
keyv
=
append
(
keyv
,
k
)
}
sort
.
Slice
(
keyv
,
func
(
i
,
j
int
)
bool
{
return
keyv
[
i
]
<
keyv
[
j
]
})
for
_
,
k
:=
range
keyv
{
v1
,
ok
:=
kv1
[
k
]
if
!
ok
{
v1
=
DEL
}
v2
,
ok
:=
kv2
[
k
]
if
!
ok
{
v2
=
DEL
}
if
v1
!=
v2
{
delta
=
append
(
delta
,
kvdelta1
{
k
,
v2
})
}
}
return
delta
}
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