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

Method varAppendMapHeader

gen/spec.go:541–547  ·  view source on GitHub ↗
(sliceVarname string, sizeVarname string, maxSize int)

Source from the content-addressed store, hash-verified

539}
540
541func (p *printer) varAppendMapHeader(sliceVarname string, sizeVarname string, maxSize int) {
542 if maxSize <= 15 {
543 p.printf("\n%s = append(%s, 0x80 | uint8(%s))", sliceVarname, sliceVarname, sizeVarname)
544 } else {
545 p.printf("\n%s = msgp.AppendMapHeader(%s, %s)", sliceVarname, sliceVarname, sizeVarname)
546 }
547}
548
549// bmask is a bitmask of a the specified number of bits
550type bmask struct {

Callers 1

mapstructMethod · 0.80

Calls 1

printfMethod · 0.95

Tested by

no test coverage detected