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

Method gArray

gen/encode.go:343–358  ·  view source on GitHub ↗
(a *Array)

Source from the content-addressed store, hash-verified

341}
342
343func (e *encodeGen) gArray(a *Array) {
344 if !e.p.ok() {
345 return
346 }
347 e.fuseHook()
348 // shortcut for [const]byte
349 if be, ok := a.Els.(*BaseElem); ok && (be.Value == Byte || be.Value == Uint8) {
350 e.p.printf("\nerr = en.WriteBytes((%s)[:])", a.Varname())
351 e.p.wrapErrCheck(e.ctx.ArgsStr())
352 return
353 }
354
355 e.writeAndCheck(arrayHeader, literalFmt, coerceArraySize(a.Size))
356 setTypeParams(a.Els, a.typeParams)
357 e.p.rangeBlock(e.ctx, a.Index, a.Varname(), e, a.Els)
358}
359
360func (e *encodeGen) gBase(b *BaseElem) {
361 if !e.p.ok() {

Callers

nothing calls this directly

Calls 10

fuseHookMethod · 0.95
writeAndCheckMethod · 0.95
coerceArraySizeFunction · 0.85
setTypeParamsFunction · 0.85
okMethod · 0.80
printfMethod · 0.80
wrapErrCheckMethod · 0.80
ArgsStrMethod · 0.80
rangeBlockMethod · 0.80
VarnameMethod · 0.65

Tested by

no test coverage detected