MCPcopy Create free account
hub / github.com/egonelbre/exp / IterSlice

Method IterSlice

bench/sortedset/sortedset.go:98–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96}
97
98func (s *Set) IterSlice() []int {
99 vals := make([]int, s.count)
100 j := 0
101 base := 0
102 df := 0
103 k := uint(0)
104 for _, b := range s.data {
105 df = df | (int(b&mask) << k)
106 k += bits
107 if b < cbit {
108 base += df
109 vals[j] = base
110 df = 0
111 k = 0
112 j += 1
113 }
114 }
115 return vals
116}
117
118func (s *Set) IterCallback(fn func(int)) {
119 j := 0

Callers 1

BenchmarkSliceFunction · 0.80

Calls

no outgoing calls

Tested by 1

BenchmarkSliceFunction · 0.64