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

Function coerceArraySize

gen/elem.go:990–992  ·  view source on GitHub ↗

coerceArraySize ensures we can compare constant array lengths. msgpack array headers are 32 bit unsigned, which is reflected in the ArrayHeader implementation in this library using uint32. On the Go side, we can declare array lengths as any constant integer width, which breaks when attempting a dir

(asz string)

Source from the content-addressed store, hash-verified

988// can declare array lengths as any constant integer width, which breaks when
989// attempting a direct comparison to an array header's uint32.
990func coerceArraySize(asz string) string {
991 return fmt.Sprintf("uint32(%s)", asz)
992}

Callers 4

gArrayMethod · 0.85
gArrayMethod · 0.85
gArrayMethod · 0.85
gArrayMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…