Skip to content

Commit d7f5fca

Browse files
committed
Modernize benchmark loops
1 parent 41fbcdc commit d7f5fca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

reader_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ func BenchmarkCity(b *testing.B) {
288288
var city *City
289289

290290
ip := make(net.IP, 4)
291-
for range b.N {
291+
for b.Loop() {
292292
randomIPv4Address(r, ip)
293293
addr, _ := netip.AddrFromSlice(ip)
294294
city, err = db.City(addr)
@@ -315,7 +315,7 @@ func BenchmarkASN(b *testing.B) {
315315
var asn *ASN
316316

317317
ip := make(net.IP, 4)
318-
for range b.N {
318+
for b.Loop() {
319319
randomIPv4Address(r, ip)
320320
addr, _ := netip.AddrFromSlice(ip)
321321
asn, err = db.ASN(addr)

0 commit comments

Comments
 (0)