| 327 | } |
| 328 | |
| 329 | func (d *decodeGen) readBytesConvertWithLimit(tmp string, allowNil bool, receiverVar string) { |
| 330 | if !d.p.ok() { |
| 331 | return |
| 332 | } |
| 333 | |
| 334 | // Check if limits exist to decide on reading strategy |
| 335 | if d.ctx.currentFieldArrayLimit != math.MaxUint32 || d.ctx.arrayLimit != math.MaxUint32 { |
| 336 | // No limits - use original efficient approach with receiver cast as destination |
| 337 | d.p.printf("\n%s, err = dc.ReadBytesLimit(%s, %d)", tmp, receiverVar, min(d.ctx.currentFieldArrayLimit, d.ctx.arrayLimit)) |
| 338 | } else { |
| 339 | // No limits - use original efficient approach with receiver cast as destination |
| 340 | d.p.printf("\n%s, err = dc.ReadBytes(%s)", tmp, receiverVar) |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | func (d *decodeGen) gBase(b *BaseElem) { |
| 345 | if !d.p.ok() { |