Browse code

tiff.c: Use switch / case instead of if / else where appropriate.

Carl Eugen Hoyos authored on 2011/12/31 09:53:22
Showing 1 changed files
... ...
@@ -108,19 +108,22 @@ static void av_always_inline horizontal_fill(unsigned int bpp, uint8_t* dst,
108 108
 {
109 109
     int i;
110 110
 
111
-    if (bpp == 2) {
111
+    switch (bpp) {
112
+    case 2:
112 113
         for (i = 0; i < width; i++) {
113 114
             dst[(i+offset)*4+0] = (usePtr ? src[i] : c) >> 6;
114 115
             dst[(i+offset)*4+1] = (usePtr ? src[i] : c) >> 4 & 0x3;
115 116
             dst[(i+offset)*4+2] = (usePtr ? src[i] : c) >> 2 & 0x3;
116 117
             dst[(i+offset)*4+3] = (usePtr ? src[i] : c) & 0x3;
117 118
         }
118
-    } else if (bpp == 4) {
119
+        break;
120
+    case 4:
119 121
         for (i = 0; i < width; i++) {
120 122
             dst[(i+offset)*2+0] = (usePtr ? src[i] : c) >> 4;
121 123
             dst[(i+offset)*2+1] = (usePtr ? src[i] : c) & 0xF;
122 124
         }
123
-    } else {
125
+        break;
126
+    default:
124 127
         if (usePtr) {
125 128
             memcpy(dst + offset, src, width);
126 129
         } else {