Skip to content

Commit

Permalink
[rt #69243] slightly simplify XS for i_gsamp()
Browse files Browse the repository at this point in the history
  • Loading branch information
tonycoz committed May 24, 2013
1 parent 0862f39 commit f37708c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Imager.xs
Expand Up @@ -3213,7 +3213,7 @@ i_gsamp(im, l, r, y, channels)
i_img_dim count, i; i_img_dim count, i;
PPCODE: PPCODE:
if (l < r) { if (l < r) {
data = mymalloc(sizeof(i_sample_t) * (r-l) * channels.count); /* XXX: memleak? */ data = mymalloc(sizeof(i_sample_t) * (r-l) * channels.count);
count = i_gsamp(im, l, r, y, data, channels.channels, channels.count); count = i_gsamp(im, l, r, y, data, channels.channels, channels.count);
if (GIMME_V == G_ARRAY) { if (GIMME_V == G_ARRAY) {
EXTEND(SP, count); EXTEND(SP, count);
Expand All @@ -3228,8 +3228,7 @@ i_gsamp(im, l, r, y, channels)
} }
else { else {
if (GIMME_V != G_ARRAY) { if (GIMME_V != G_ARRAY) {
EXTEND(SP, 1); XSRETURN_UNDEF;
PUSHs(&PL_sv_undef);
} }
} }


Expand Down

0 comments on commit f37708c

Please sign in to comment.