decodeU decodes uint32 obtained from the reader dec.in. The goal is to reduce memory allocs.
()
| 100 | // decodeU decodes uint32 obtained from the reader dec.in. |
| 101 | // The goal is to reduce memory allocs. |
| 102 | func (dec *decoder) decodeU() uint32 { |
| 103 | dec.align(4) |
| 104 | dec.read2buf(4) |
| 105 | dec.pos += 4 |
| 106 | return dec.order.Uint32(dec.buf) |
| 107 | } |
| 108 | |
| 109 | func (dec *decoder) decode(s string, depth int) any { |
| 110 | dec.align(alignment(typeFor(s))) |