Unverified Commit 41df6145 authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #10 from libp2p/fix/alloc-less

reduce subtract filter allocations to one
parents b323312d bb673864
......@@ -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
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment