MCPcopy Index your code
hub / github.com/google/gvisor / decodeArray

Method decodeArray

pkg/state/decode.go:436–445  ·  view source on GitHub ↗

decodeArray decodes an array value.

(ods *objectDecodeState, obj reflect.Value, encoded *wire.Array)

Source from the content-addressed store, hash-verified

434
435// decodeArray decodes an array value.
436func (ds *decodeState) decodeArray(ods *objectDecodeState, obj reflect.Value, encoded *wire.Array) {
437 if len(encoded.Contents) != obj.Len() {
438 Failf("mismatching array length expect=%d, actual=%d", obj.Len(), len(encoded.Contents))
439 }
440 // Decode the contents into the array.
441 for i := 0; i < len(encoded.Contents); i++ {
442 ds.decodeObject(ods, obj.Index(i), encoded.Contents[i])
443 ds.waitObject(ods, encoded.Contents[i], nil)
444 }
445}
446
447// findType finds the type for the given wire.TypeSpecs.
448func (ds *decodeState) findType(t wire.TypeSpec) reflect.Type {

Callers 1

decodeObjectMethod · 0.95

Calls 5

decodeObjectMethod · 0.95
waitObjectMethod · 0.95
FailfFunction · 0.85
LenMethod · 0.65
IndexMethod · 0.45

Tested by

no test coverage detected