(sliceVarname string, sizeVarname string, maxSize int)
| 539 | } |
| 540 | |
| 541 | func (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 |
| 550 | type bmask struct { |