Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bio-rd
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
bio-rd
Commits
2f52452b
Commit
2f52452b
authored
5 years ago
by
takt
Browse files
Options
Downloads
Patches
Plain Diff
Fix Less method
parent
f23bac7e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
net/prefix.go
+7
-6
7 additions, 6 deletions
net/prefix.go
with
7 additions
and
6 deletions
net/prefix.go
+
7
−
6
View file @
2f52452b
...
@@ -6,7 +6,6 @@ import (
...
@@ -6,7 +6,6 @@ import (
gonet
"net"
gonet
"net"
"strconv"
"strconv"
"strings"
"strings"
"unsafe"
"github.com/bio-routing/bio-rd/net/api"
"github.com/bio-routing/bio-rd/net/api"
"github.com/google/btree"
"github.com/google/btree"
...
@@ -24,18 +23,20 @@ func (p *Prefix) Dedup() *Prefix {
...
@@ -24,18 +23,20 @@ func (p *Prefix) Dedup() *Prefix {
return
pfxc
.
get
(
p
)
return
pfxc
.
get
(
p
)
}
}
<<<<<<<
HEAD
=======
// Less compares prefixes for use in btree.Btree
// Less compares prefixes for use in btree.Btree
func
(
p
*
Prefix
)
Less
(
other
btree
.
Item
)
bool
{
func
(
p
*
Prefix
)
Less
(
other
btree
.
Item
)
bool
{
if
uintptr
(
unsafe
.
Pointer
(
p
.
addr
))
<
uintptr
(
unsafe
.
Pointer
(
other
.
(
*
Prefix
)
.
addr
))
{
switch
p
.
addr
.
Compare
(
other
.
(
*
Prefix
)
.
addr
)
{
case
0
:
return
p
.
pfxlen
<
other
.
(
*
Prefix
)
.
pfxlen
case
-
1
:
return
true
return
true
case
1
:
return
false
}
}
return
p
.
pfxlen
<
other
.
(
*
Prefix
)
.
pfxlen
return
false
}
}
>>>>>>>
9
a2f84b22a4aac17b61e2cdddefd23f228234246
// DedupWithIP gets a copy of Prefix from the cache and dedups the IP part
// DedupWithIP gets a copy of Prefix from the cache and dedups the IP part
func
(
p
*
Prefix
)
DedupWithIP
()
*
Prefix
{
func
(
p
*
Prefix
)
DedupWithIP
()
*
Prefix
{
p
.
addr
=
p
.
addr
.
Dedup
()
p
.
addr
=
p
.
addr
.
Dedup
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment