]> git.imager.perl.org - imager.git/commitdiff
avoid dead code in i_get_anonymous_color_histo()
authorTony Cook <tony@develop-help.com>
Wed, 2 Jan 2019 07:56:32 +0000 (18:56 +1100)
committerTony Cook <tony@develop-help.com>
Wed, 2 Jan 2019 07:56:32 +0000 (18:56 +1100)
Changes
Imager.xs

diff --git a/Changes b/Changes
index 97c275a67b3ed8ff092424bd5c02019f204434b3..fde0e81f66c6ff4f58d684461bc9c46ed4ab42cf 100644 (file)
--- a/Changes
+++ b/Changes
@@ -66,6 +66,9 @@ High severity:
 
  - avoid dead code in i_tt_glyph_names(). CID 185321.
 
+ - avoid dead code in i_get_anonymous_color_histo(), which is the
+   implementation of getcolorusage().  CID 185327.
+
 Imager 1.008 - 31 Dec 2018
 ============
 
index 7f428e338e462b47e06503b70e871d5213cff218..7017e9a7b5298897f373cc35145ad25c3e3b41b6 100644 (file)
--- a/Imager.xs
+++ b/Imager.xs
@@ -2670,17 +2670,14 @@ i_get_anonymous_color_histo(im, maxc = 0x40000000)
         int col_cnt;
     PPCODE:
        col_cnt = i_get_anonymous_color_histo(im, &col_usage, maxc);
-        if (col_cnt > 0) {
-            EXTEND(SP, col_cnt);
-            for (i = 0; i < col_cnt; i++)  {
-                PUSHs(sv_2mortal(newSViv( col_usage[i])));
-            }
-            myfree(col_usage);
-            XSRETURN(col_cnt);
-        }
-        else {
-            XSRETURN_EMPTY;
+        if (col_cnt <= 0) {
+           XSRETURN_EMPTY;
+       }
+        EXTEND(SP, col_cnt);
+        for (i = 0; i < col_cnt; i++)  {
+            PUSHs(sv_2mortal(newSViv( col_usage[i])));
         }
+        myfree(col_usage);
 
 
 void