Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Generics Support #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
```
Create a new ranger implemented using Path-Compressed prefix trie.
```go
ipt := iptrie.NewTrie()
ipt := iptrie.NewTrie[any]()
```

Inserts CIDR blocks.
Expand Down Expand Up @@ -71,8 +71,8 @@ ipt.ContainingNetworks(netip.MustParseAddr("10.1.0.0"))
For insertion of a large number (millions) of addresses, it will likely be much faster to use TrieLoader.

```go
ipt := iptrie.NewTrie()
loader := iptrie.NewTrieLoader(ipt)
ipt := iptrie.NewTrie[any]()
loader := iptrie.NewTrieLoader[any](ipt)

for network in []string{
"10.0.0.0/8",
Expand Down
4 changes: 2 additions & 2 deletions benchmark/benchmark_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func parseToTable(buf *bytes.Buffer) string {

pkgNames := []string{}
for _, times := range testTimes {
for k, _ := range times {
for k := range times {
pkgNames = append(pkgNames, k)
}
break
Expand All @@ -105,7 +105,7 @@ func parseToTable(buf *bytes.Buffer) string {
tbl.SetAutoFormatHeaders(false)
tbl.SetHeader(append([]string{"*(OPs/Sec)*"}, pkgNames...))
var testNames []string
for testName, _ := range testTimes {
for testName := range testTimes {
testNames = append(testNames, testName)
}
sort.Strings(testNames)
Expand Down
Loading