… | |
… | |
506 | else if (SvIOKp (sv)) |
506 | else if (SvIOKp (sv)) |
507 | { |
507 | { |
508 | // we assume we can always read an IV as a UV |
508 | // we assume we can always read an IV as a UV |
509 | if (SvUV (sv) & ~(UV)0x7fff) |
509 | if (SvUV (sv) & ~(UV)0x7fff) |
510 | { |
510 | { |
511 | need (enc, 32); |
511 | need (enc, 64); |
512 | enc->cur += |
512 | enc->cur += |
513 | SvIsUV(sv) |
513 | SvIsUV(sv) |
514 | ? snprintf (enc->cur, 32, "%"UVuf, (UV)SvUVX (sv)) |
514 | ? snprintf (enc->cur, 64, "%"UVuf, (UV)SvUVX (sv)) |
515 | : snprintf (enc->cur, 32, "%"IVdf, (IV)SvIVX (sv)); |
515 | : snprintf (enc->cur, 64, "%"IVdf, (IV)SvIVX (sv)); |
516 | } |
516 | } |
517 | else |
517 | else |
518 | { |
518 | { |
519 | // optimise the "small number case" |
519 | // optimise the "small number case" |
520 | // code will likely be branchless and use only a single multiplication |
520 | // code will likely be branchless and use only a single multiplication |