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

Method writeAndCheckWithMapLimit

gen/encode.go:53–61  ·  view source on GitHub ↗
(typ string, argfmt string, arg any)

Source from the content-addressed store, hash-verified

51}
52
53func (e *encodeGen) writeAndCheckWithMapLimit(typ string, argfmt string, arg any) {
54 e.writeAndCheck(typ, argfmt, arg)
55 if e.ctx.marshalLimits && e.ctx.mapLimit != math.MaxUint32 {
56 e.p.printf("\nif %s > %slimitMaps {", fmt.Sprintf(argfmt, arg), e.ctx.limitPrefix)
57 e.p.printf("\nerr = msgp.ErrLimitExceeded")
58 e.p.printf("\nreturn")
59 e.p.printf("\n}")
60 }
61}
62
63func (e *encodeGen) fuseHook() {
64 if len(e.fuse) > 0 {

Callers 1

gMapMethod · 0.95

Calls 2

writeAndCheckMethod · 0.95
printfMethod · 0.80

Tested by

no test coverage detected