]> git.imager.perl.org - imager.git/commitdiff
avoid an unneeded EXTEND() call when the FT2 has_chars() implementation returns 0.
authorTony Cook <tony@develop-help.com>
Wed, 2 Jan 2019 08:08:57 +0000 (19:08 +1100)
committerTony Cook <tony@develop-help.com>
Wed, 2 Jan 2019 08:08:57 +0000 (19:08 +1100)
Changes
FT2/Changes
FT2/FT2.xs

diff --git a/Changes b/Changes
index 0fa06a2038ad17c2e9bf91df03d6c018b27b3b70..dc885fa93eff19d94b20807a91ebc29843bdc4c7 100644 (file)
--- a/Changes
+++ b/Changes
@@ -72,6 +72,9 @@ High severity:
  - avoid dead code in i_ft2_glyph_name(), which is the implementation
    of glyph_names() for FT2.  CID 185342.
 
+ - avoid an unneeded EXTEND() call when the FT2 has_chars()
+   implementation returns 0. CID 185292.
+
 Imager 1.008 - 31 Dec 2018
 ============
 
index 8d6b5e1c28f0cbeb99ae460403586e24e73b170a..4a874decc2d00224144c40b0da1a8afab2209a4b 100644 (file)
@@ -4,6 +4,9 @@ Imager-Font-FT2 0.95
  - avoid dead code in i_ft2_glyph_name(), which is the implementation
    of glyph_names().  CID 185342.
 
+ - avoid an unneeded EXTEND() call when the FT2 has_chars()
+   implementation returns 0. CID 185292.
+
 Imager-Font-FT2 0.94
 ====================
 
index dd934427da56a37568ed84b1412f037865a53f34..e1c4de44a13ba9ca6b20289122872cc66eec1c71 100644 (file)
@@ -243,10 +243,12 @@ i_ft2_has_chars(handle, text_sv, utf8)
         work = mymalloc(len);
         count = i_ft2_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);