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 9307d16..dffe2d2 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);