MCPcopy Create free account
hub / github.com/cantabular/faststringmap / typicalCodeStrings

Function typicalCodeStrings

uint32_store_test.go:106–118  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

104}
105
106func typicalCodeStrings(n int) mapSlice {
107 m := make(map[string]uint32, n)
108 keys := make([]string, 0, n)
109 add := func(s string) {
110 m[s] = uint32(len(m))
111 keys = append(keys, s)
112 }
113 for i := 1; i < n; i++ {
114 add(strconv.Itoa(i))
115 }
116 add("-9")
117 return mapSlice{m: m, in: keys}
118}
119
120const nStrsBench = 1000
121

Callers 2

BenchmarkUint32StoreFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected