From: Tony Cook Date: Wed, 2 Jan 2019 00:09:04 +0000 (+1100) Subject: avoid an unneeded check in the FT1 has_chars() method implementation X-Git-Tag: v1.009~30 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/7eb58d07cc2da8032075c7e4b75ac6df2007861c?ds=inline avoid an unneeded check in the FT1 has_chars() method implementation --- diff --git a/Imager.xs b/Imager.xs index 9307d16a..dffe2d29 100644 --- a/Imager.xs +++ b/Imager.xs @@ -2471,10 +2471,12 @@ i_tt_has_chars(handle, text_sv, utf8) work = mymalloc(len); count = i_tt_has_chars(handle, text, len, utf8, work); if (GIMME_V == G_ARRAY) { - EXTEND(SP, count); - for (i = 0; i < count; ++i) { - PUSHs(boolSV(work[i])); - } + if (count) { + EXTEND(SP, count); + for (i = 0; i < count; ++i) { + PUSHs(boolSV(work[i])); + } + } } else { EXTEND(SP, 1);