(multiplier int)
| 753 | } |
| 754 | |
| 755 | func benchmarkMapString_Has(multiplier int) func(b *testing.B) { |
| 756 | m := make(map[string]bool) |
| 757 | a := "12345678" |
| 758 | for i := 0; i < 1000*multiplier; i++ { |
| 759 | m[a+strconv.Itoa(i)] = true |
| 760 | } |
| 761 | |
| 762 | return func(b *testing.B) { |
| 763 | for i := 0; i < b.N; i++ { |
| 764 | _ = m[a+strconv.Itoa(i%1000*multiplier)] |
| 765 | } |
| 766 | } |
| 767 | } |
| 768 | |
| 769 | func BenchmarkMapString_Has(b *testing.B) { |
| 770 | benchmarkMapString_Has(1)(b) |
no outgoing calls
no test coverage detected
searching dependent graphs…