Commit 3026131d authored by Dimitri van Heesch's avatar Dimitri van Heesch

Bug 736029 - [PATCH] Remove redundant if/else branch in src/lodepng.cpp

parent e7b9f1d1
......@@ -3535,20 +3535,11 @@ static void filterScanline(unsigned char* out, const unsigned char* scanline, co
switch(filterType)
{
case 0:
if(prevline) for(i = 0; i < length; i++) out[i] = scanline[i];
else for(i = 0; i < length; i++) out[i] = scanline[i];
for(i = 0; i < length; i++) out[i] = scanline[i];
break;
case 1:
if(prevline)
{
for(i = 0; i < bytewidth; i++) out[i] = scanline[i];
for(i = bytewidth; i < length ; i++) out[i] = scanline[i] - scanline[i - bytewidth];
}
else
{
for(i = 0; i < bytewidth; i++) out[i] = scanline[i];
for(i = bytewidth; i < length; i++) out[i] = scanline[i] - scanline[i - bytewidth];
}
for(i = 0; i < bytewidth; i++) out[i] = scanline[i];
for(i = bytewidth; i < length; i++) out[i] = scanline[i] - scanline[i - bytewidth];
break;
case 2:
if(prevline) for(i = 0; i < length; i++) out[i] = scanline[i] - prevline[i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment