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
edfb66a5
Commit
edfb66a5
authored
Sep 27, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
696428d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
wcfs/internal/xbtree/blib/rangemap.go.in
wcfs/internal/xbtree/blib/rangemap.go.in
+13
-11
No files found.
wcfs/internal/xbtree/blib/rangemap.go.in
View file @
edfb66a5
...
...
@@ -168,7 +168,7 @@ func (M *RangedMap) SetRange(r KeyRange, v VALUE) {
}
//
DelRange
removes
range
r
from
the
map
.
func
(
M
*
Ranged
KeySet
)
DelRange
(
r
KeyRange
)
{
func
(
M
*
Ranged
Map
)
DelRange
(
r
KeyRange
)
{
if
traceRangeSet
{
fmt
.
Printf
(
"
\n\n
DelRange:
\n
"
)
fmt
.
Printf
(
" M: %s
\n
"
,
M
)
...
...
@@ -238,7 +238,7 @@ func (M *RangedKeySet) DelRange(r KeyRange) {
}
//
HasRange
returns
whether
all
keys
from
range
r
belong
to
the
set
.
func
(
S
*
Ranged
KeySet
)
HasRange
(
r
KeyRange
)
(
yes
bool
)
{
func
(
S
*
Ranged
Map
)
HasRange
(
r
KeyRange
)
(
yes
bool
)
{
if
traceRangeSet
{
fmt
.
Printf
(
"
\n\n
HasRange:
\n
"
)
fmt
.
Printf
(
" S: %s
\n
"
,
S
)
...
...
@@ -313,10 +313,12 @@ func (M *RangedMap) verify() {
}
}
//
Clone
returns
copy
of
the
set
.
func
(
orig
*
RangedKeySet
)
Clone
()
*
RangedKeySet
{
klon
:=
&
RangedKeySet
{}
klon
.
rangev
=
append
(
klon
.
rangev
,
orig
.
rangev
...)
//
Clone
returns
copy
of
the
map
.
//
//
NOTE
values
are
_not_
cloned
.
func
(
orig
*
RangedMap
)
Clone
()
*
RangedMap
{
klon
:=
&
RangedMap
{}
klon
.
entryv
=
append
(
klon
.
entryv
,
orig
.
entryv
...)
return
klon
}
...
...
@@ -326,13 +328,13 @@ func (M *RangedMap) Empty() bool {
}
//
Equal
returns
whether
A
==
B
.
func
(
A
*
Ranged
KeySet
)
Equal
(
B
*
RangedKeySet
)
bool
{
if
len
(
A
.
rangev
)
!= len(B.range
v) {
func
(
A
*
Ranged
Map
)
Equal
(
B
*
RangedMap
)
bool
{
if
len
(
A
.
entryv
)
!= len(B.entry
v) {
return
false
}
for
i
,
ra
:=
range
A
.
range
v
{
rb
:=
B
.
range
v
[
i
]
if
ra
!= r
b {
for
i
,
ea
:=
range
A
.
entry
v
{
eb
:=
B
.
entry
v
[
i
]
if
ea
!= e
b {
return
false
}
}
...
...
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