summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-09-09 21:02:45 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-09-09 21:02:45 (GMT)
commit3026131de3126298863d1a68fe0c747524e26e43 (patch)
treec281830ade503a5384aff3b3f8f2bca045c78ff2 /src
parente7b9f1d16ea2043be068c448676e368e9239314e (diff)
downloadDoxygen-3026131de3126298863d1a68fe0c747524e26e43.zip
Doxygen-3026131de3126298863d1a68fe0c747524e26e43.tar.gz
Doxygen-3026131de3126298863d1a68fe0c747524e26e43.tar.bz2
Bug 736029 - [PATCH] Remove redundant if/else branch in src/lodepng.cpp
Diffstat (limited to 'src')
-rw-r--r--src/lodepng.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/lodepng.cpp b/src/lodepng.cpp
index b237d5a..3bf1d46 100644
--- a/src/lodepng.cpp
+++ b/src/lodepng.cpp
@@ -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];