MCPcopy Create free account
hub / github.com/peterbourgon/diskv / blockTransform

Function blockTransform

keys_test.go:156–168  ·  view source on GitHub ↗
(blockSize int)

Source from the content-addressed store, hash-verified

154}
155
156func blockTransform(blockSize int) func(string) []string {
157 return func(s string) []string {
158 var (
159 sliceSize = len(s) / blockSize
160 pathSlice = make([]string, sliceSize)
161 )
162 for i := 0; i < sliceSize; i++ {
163 from, to := i*blockSize, (i*blockSize)+blockSize
164 pathSlice[i] = s[from:to]
165 }
166 return pathSlice
167 }
168}
169
170func filterPrefix(in map[string]string, prefix string) map[string]string {
171 out := map[string]string{}

Callers 2

TestKeysNestedFunction · 0.70
TestKeysPrefixNestedFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…