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
7ae1abd4
Commit
7ae1abd4
authored
Sep 29, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a5b9b19b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
6 deletions
+18
-6
wcfs/internal/xbtree/blib/rangemap.go.in
wcfs/internal/xbtree/blib/rangemap.go.in
+2
-2
wcfs/internal/xbtree/blib/rangemap_test.go
wcfs/internal/xbtree/blib/rangemap_test.go
+12
-0
wcfs/internal/xbtree/blib/zrangemap_str.go
wcfs/internal/xbtree/blib/zrangemap_str.go
+2
-2
wcfs/internal/xbtree/blib/zrangemap_void.go
wcfs/internal/xbtree/blib/zrangemap_void.go
+2
-2
No files found.
wcfs/internal/xbtree/blib/rangemap.go.in
View file @
7ae1abd4
...
@@ -323,13 +323,13 @@ func (M *RangedMap) delRange(r KeyRange) (i int) {
...
@@ -323,13 +323,13 @@ func (M *RangedMap) delRange(r KeyRange) (i int) {
}
}
if
M
.
entryv
[
ilo
].
Lo
<
r
.
Lo
{
//
shrink
left
if
M
.
entryv
[
ilo
].
Lo
<
r
.
Lo
{
//
shrink
left
M
.
entryv
[
ilo
].
Hi_
=
r
.
Lo
-
1
M
.
entryv
[
ilo
].
Hi_
=
r
.
Lo
-
1
ilo
++
debugfRMap
(
"
\t
shrink [%d] left
\t
-> %s
\n
"
,
ilo
,
M
)
debugfRMap
(
"
\t
shrink [%d] left
\t
-> %s
\n
"
,
ilo
,
M
)
ilo
++
}
}
if
r
.
Hi_
<
M
.
entryv
[
jhi
-
1
].
Hi_
{
//
shrink
right
if
r
.
Hi_
<
M
.
entryv
[
jhi
-
1
].
Hi_
{
//
shrink
right
M
.
entryv
[
jhi
-
1
].
Lo
=
r
.
Hi_
+
1
M
.
entryv
[
jhi
-
1
].
Lo
=
r
.
Hi_
+
1
jhi
--
debugfRMap
(
"
\t
shrink [%d] right
\t
-> %s
\n
"
,
jhi
-
1
,
M
)
debugfRMap
(
"
\t
shrink [%d] right
\t
-> %s
\n
"
,
jhi
-
1
,
M
)
jhi
--
}
}
if
(
jhi
-
ilo
)
>
0
{
if
(
jhi
-
ilo
)
>
0
{
...
...
wcfs/internal/xbtree/blib/rangemap_test.go
View file @
7ae1abd4
...
@@ -113,6 +113,18 @@ func TestRangedMap(t *testing.T) {
...
@@ -113,6 +113,18 @@ func TestRangedMap(t *testing.T) {
n
),
// Has
n
),
// Has
// - shrink left/right (value !same) + new entry
// - shrink left/right (value !same) + new entry
E
(
M
(
1
,
4
,
a
),
// A
K
(
2
,
6
,
x
),
// B
M
(
1
,
2
,
a
,
2
,
6
,
x
),
// Set
M
(
1
,
2
,
a
),
// Del
n
),
// Has
E
(
M
(
5
,
8
,
b
),
// A
K
(
2
,
6
,
x
),
// B
M
(
2
,
6
,
x
,
6
,
8
,
b
),
// Set
M
(
6
,
8
,
b
),
// Del
n
),
// Has
E
(
E
(
M
(
1
,
4
,
a
,
5
,
8
,
b
),
// A
M
(
1
,
4
,
a
,
5
,
8
,
b
),
// A
K
(
2
,
6
,
x
),
// B
K
(
2
,
6
,
x
),
// B
...
...
wcfs/internal/xbtree/blib/zrangemap_str.go
View file @
7ae1abd4
...
@@ -325,13 +325,13 @@ func (M *_RangedMap_str) delRange(r KeyRange) (i int) {
...
@@ -325,13 +325,13 @@ func (M *_RangedMap_str) delRange(r KeyRange) (i int) {
}
}
if
M
.
entryv
[
ilo
]
.
Lo
<
r
.
Lo
{
// shrink left
if
M
.
entryv
[
ilo
]
.
Lo
<
r
.
Lo
{
// shrink left
M
.
entryv
[
ilo
]
.
Hi_
=
r
.
Lo
-
1
M
.
entryv
[
ilo
]
.
Hi_
=
r
.
Lo
-
1
ilo
++
debugf_RangedMap_str
(
"
\t
shrink [%d] left
\t
-> %s
\n
"
,
ilo
,
M
)
debugf_RangedMap_str
(
"
\t
shrink [%d] left
\t
-> %s
\n
"
,
ilo
,
M
)
ilo
++
}
}
if
r
.
Hi_
<
M
.
entryv
[
jhi
-
1
]
.
Hi_
{
// shrink right
if
r
.
Hi_
<
M
.
entryv
[
jhi
-
1
]
.
Hi_
{
// shrink right
M
.
entryv
[
jhi
-
1
]
.
Lo
=
r
.
Hi_
+
1
M
.
entryv
[
jhi
-
1
]
.
Lo
=
r
.
Hi_
+
1
jhi
--
debugf_RangedMap_str
(
"
\t
shrink [%d] right
\t
-> %s
\n
"
,
jhi
-
1
,
M
)
debugf_RangedMap_str
(
"
\t
shrink [%d] right
\t
-> %s
\n
"
,
jhi
-
1
,
M
)
jhi
--
}
}
if
(
jhi
-
ilo
)
>
0
{
if
(
jhi
-
ilo
)
>
0
{
...
...
wcfs/internal/xbtree/blib/zrangemap_void.go
View file @
7ae1abd4
...
@@ -325,13 +325,13 @@ func (M *_RangedMap_void) delRange(r KeyRange) (i int) {
...
@@ -325,13 +325,13 @@ func (M *_RangedMap_void) delRange(r KeyRange) (i int) {
}
}
if
M
.
entryv
[
ilo
]
.
Lo
<
r
.
Lo
{
// shrink left
if
M
.
entryv
[
ilo
]
.
Lo
<
r
.
Lo
{
// shrink left
M
.
entryv
[
ilo
]
.
Hi_
=
r
.
Lo
-
1
M
.
entryv
[
ilo
]
.
Hi_
=
r
.
Lo
-
1
ilo
++
debugf_RangedMap_void
(
"
\t
shrink [%d] left
\t
-> %s
\n
"
,
ilo
,
M
)
debugf_RangedMap_void
(
"
\t
shrink [%d] left
\t
-> %s
\n
"
,
ilo
,
M
)
ilo
++
}
}
if
r
.
Hi_
<
M
.
entryv
[
jhi
-
1
]
.
Hi_
{
// shrink right
if
r
.
Hi_
<
M
.
entryv
[
jhi
-
1
]
.
Hi_
{
// shrink right
M
.
entryv
[
jhi
-
1
]
.
Lo
=
r
.
Hi_
+
1
M
.
entryv
[
jhi
-
1
]
.
Lo
=
r
.
Hi_
+
1
jhi
--
debugf_RangedMap_void
(
"
\t
shrink [%d] right
\t
-> %s
\n
"
,
jhi
-
1
,
M
)
debugf_RangedMap_void
(
"
\t
shrink [%d] right
\t
-> %s
\n
"
,
jhi
-
1
,
M
)
jhi
--
}
}
if
(
jhi
-
ilo
)
>
0
{
if
(
jhi
-
ilo
)
>
0
{
...
...
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