MCPcopy
hub / github.com/tinylib/msgp / AsSlice

Method AsSlice

msgp/setof/generated.go:325–334  ·  view source on GitHub ↗

AsSlice returns the set as a slice.

()

Source from the content-addressed store, hash-verified

323
324// AsSlice returns the set as a slice.
325func (s Int) AsSlice() []int {
326 if s == nil {
327 return nil
328 }
329 dst := make([]int, 0, len(s))
330 for k := range s {
331 dst = append(dst, k)
332 }
333 return dst
334}
335
336// DecodeMsg decodes the message from the reader.
337func (s *Int) DecodeMsg(reader *msgp.Reader) error {

Callers 15

TestInt_NilHandlingFunction · 0.95
TestString_AsSliceFunction · 0.45
TestStringSorted_AsSliceFunction · 0.45
BenchmarkString_AsSliceFunction · 0.45
TestInt_AsSliceFunction · 0.45
TestIntSorted_AsSliceFunction · 0.45
BenchmarkInt_AsSliceFunction · 0.45
TestUint_AsSliceFunction · 0.45
TestUintSorted_AsSliceFunction · 0.45
BenchmarkUint_AsSliceFunction · 0.45

Calls

no outgoing calls

Tested by 15

TestInt_NilHandlingFunction · 0.76
TestString_AsSliceFunction · 0.36
TestStringSorted_AsSliceFunction · 0.36
BenchmarkString_AsSliceFunction · 0.36
TestInt_AsSliceFunction · 0.36
TestIntSorted_AsSliceFunction · 0.36
BenchmarkInt_AsSliceFunction · 0.36
TestUint_AsSliceFunction · 0.36
TestUintSorted_AsSliceFunction · 0.36
BenchmarkUint_AsSliceFunction · 0.36