[devel] Revised the new test

to run faster in the usual PNG_ALL_FILTERS case.  The previous, more
accurate test, would save some computation in uncommon cases, but is
probably not worth while in the long run.
This commit is contained in:
Glenn Randers-Pehrson 2009-07-19 15:04:35 -05:00
parent 9d8b41ea6f
commit 4ace0e1530

View File

@ -2135,9 +2135,7 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
png_debug(1, "in png_write_find_filter");
#ifndef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
if ((png_ptr->row_number == 0) &&
(filter_to_do & PNG_FILTER_NONE) &&
(filter_to_do & PNG_FILTER_SUB))
if (png_ptr->row_number == 0 && filter_to_do == PNG_ALL_FILTERS)
{
/* These will never be selected so we need not test them. */
filter_to_do &= ~(PNG_FILTER_UP | PNG_FILTER_PAETH);