MCPcopy
hub / github.com/openacid/slim / encodeValues

Function encodeValues

trie/slimtrie_create.go:555–569  ·  view source on GitHub ↗
(n int, values interface{}, e encode.Encoder)

Source from the content-addressed store, hash-verified

553}
554
555func encodeValues(n int, values interface{}, e encode.Encoder) [][]byte {
556 if values == nil {
557 return nil
558 }
559
560 vals := make([][]byte, 0, n)
561 rvals := reflect.ValueOf(values)
562
563 for i := 0; i < n; i++ {
564 v := getV(rvals, int32(i))
565 bs := e.Encode(v)
566 vals = append(vals, bs)
567 }
568 return vals
569}
570
571// newValueToKeep creates a slice indicating which key to keep.
572// Value of key[i+1] with the same value with key[i] do not need to keep.

Callers 1

NewSlimTrieFunction · 0.85

Calls 2

getVFunction · 0.85
EncodeMethod · 0.65

Tested by

no test coverage detected