MCPcopy Create free account
hub / github.com/segmentio/encoding / decodeUint32

Method decodeUint32

json/decode.go:195–211  ·  view source on GitHub ↗
(b []byte, p unsafe.Pointer)

Source from the content-addressed store, hash-verified

193}
194
195func (d decoder) decodeUint32(b []byte, p unsafe.Pointer) ([]byte, error) {
196 if hasNullPrefix(b) {
197 return b[4:], nil
198 }
199
200 v, r, err := d.parseUint(b, uint32Type)
201 if err != nil {
202 return r, err
203 }
204
205 if v > math.MaxUint32 {
206 return r, unmarshalOverflow(b[:len(b)-len(r)], uint32Type)
207 }
208
209 *(*uint32)(p) = uint32(v)
210 return r, nil
211}
212
213func (d decoder) decodeUint64(b []byte, p unsafe.Pointer) ([]byte, error) {
214 if hasNullPrefix(b) {

Callers

nothing calls this directly

Calls 3

parseUintMethod · 0.95
hasNullPrefixFunction · 0.85
unmarshalOverflowFunction · 0.85

Tested by

no test coverage detected