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
1cbb2749
Commit
1cbb2749
authored
Jun 02, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
ecd23f2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
wcfs/internal/xbtree/rangeset.go
wcfs/internal/xbtree/rangeset.go
+24
-2
No files found.
wcfs/internal/xbtree/rangeset.go
View file @
1cbb2749
...
@@ -36,12 +36,12 @@ type RangeSet struct {
...
@@ -36,12 +36,12 @@ type RangeSet struct {
rangev
[]
Range
// lo↑
rangev
[]
Range
// lo↑
}
}
// Add adds Range r to the set of keys.
// Add adds Range r to the set of keys.
// XXX -> UnionInplace1 ?
func
(
S
*
RangeSet
)
Add
(
r
Range
)
{
func
(
S
*
RangeSet
)
Add
(
r
Range
)
{
panic
(
"TODO"
)
// XXX
panic
(
"TODO"
)
// XXX
}
}
// Del removes Range r from the set of keys.
// Del removes Range r from the set of keys.
// XXX -> DifferenceInplace1 ?
func
(
S
*
RangeSet
)
Del
(
r
Range
)
{
func
(
S
*
RangeSet
)
Del
(
r
Range
)
{
panic
(
"TODO"
)
// XXX
panic
(
"TODO"
)
// XXX
}
}
...
@@ -70,6 +70,28 @@ func (A *RangeSet) Difference(B *RangeSet) *RangeSet {
...
@@ -70,6 +70,28 @@ func (A *RangeSet) Difference(B *RangeSet) *RangeSet {
// XXX Intersection
// XXX Intersection
func
(
A
*
RangeSet
)
UnionInplace
(
B
*
RangeSet
)
{
A
.
verify
()
B
.
verify
()
defer
A
.
verify
()
// XXX dumb
for
_
,
r
:=
range
B
.
rangev
{
A
.
Add
(
r
)
}
}
func
(
A
*
RangeSet
)
DifferenceInplace
(
B
*
RangeSet
)
{
A
.
verify
()
B
.
verify
()
defer
A
.
verify
()
// XXX dumb
for
_
,
r
:=
range
B
.
rangev
{
A
.
Del
(
r
)
}
}
// --------
// --------
...
...
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