Skip to content

Commit

Permalink
Simplify grow_out()
Browse files Browse the repository at this point in the history
  • Loading branch information
JRaspass committed Aug 15, 2014
1 parent a90bc7e commit e0abdbe
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions JavaBin.c
Expand Up @@ -391,15 +391,15 @@ read_array: {
}
}

static void grow_out(pTHX_ uint32_t want) {
if ( out_buf + want < (uint8_t *)SvPVX(out_sv) + SvLEN(out_sv) )
return;

uint32_t len = out_buf - (uint8_t *)SvPVX(out_sv);
static void grow_out(pTHX_ const uint32_t want) {
const uint32_t len = out_buf - (uint8_t *)SvPVX(out_sv);

Perl_sv_grow(aTHX_ out_sv, len + want);
// If we want more than we have, realloc the string.
if (len + want >= SvLEN(out_sv)) {
Perl_sv_grow(aTHX_ out_sv, len + want);

out_buf = (uint8_t *)SvPVX(out_sv) + len;
out_buf = (uint8_t *)SvPVX(out_sv) + len;
}
}

static void write_v_int(uint32_t i) {
Expand Down

0 comments on commit e0abdbe

Please sign in to comment.