From: Tony Cook Date: Wed, 2 Jan 2019 07:56:32 +0000 (+1100) Subject: avoid dead code in i_get_anonymous_color_histo() X-Git-Tag: v1.009~24 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/8b810590436c296f9eb0992cf444b14fdaa8a933 avoid dead code in i_get_anonymous_color_histo() --- diff --git a/Changes b/Changes index 97c275a6..fde0e81f 100644 --- 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 ============ diff --git a/Imager.xs b/Imager.xs index 7f428e33..7017e9a7 100644 --- 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