Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-addrutil
Commits
41df6145
Unverified
Commit
41df6145
authored
Dec 06, 2017
by
Steven Allen
Committed by
GitHub
Dec 06, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10 from libp2p/fix/alloc-less
reduce subtract filter allocations to one
parents
b323312d
bb673864
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
filter.go
filter.go
+1
-1
No files found.
filter.go
View file @
41df6145
...
...
@@ -7,7 +7,7 @@ import (
// SubtractFilter returns a filter func that filters all of the given addresses
func
SubtractFilter
(
addrs
...
ma
.
Multiaddr
)
func
(
ma
.
Multiaddr
)
bool
{
addrmap
:=
make
(
map
[
string
]
bool
)
addrmap
:=
make
(
map
[
string
]
bool
,
len
(
addrs
)
)
for
_
,
a
:=
range
addrs
{
addrmap
[
string
(
a
.
Bytes
())]
=
true
}
...
...
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