]> git.imager.perl.org - imager.git/commitdiff
avoid an unneeded check in the FT1 has_chars() method implementation
authorTony Cook <tony@develop-help.com>
Wed, 2 Jan 2019 00:09:04 +0000 (11:09 +1100)
committerTony Cook <tony@develop-help.com>
Wed, 2 Jan 2019 00:09:04 +0000 (11:09 +1100)
Imager.xs

index 9307d16a3ce870e37d7f5f1c00fd58fdcd931243..dffe2d297e549f4d48b590bdb588538773aa126d 100644 (file)
--- 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);