replaces subtraction with XOR in FLUSH
authorMoritz Hanke <hanke@dkrz.de>
Tue, 9 Sep 2014 14:56:05 +0000 (16:56 +0200)
committerMathis Rosenhauer <rosenhauer@dkrz.de>
Fri, 24 Oct 2014 14:08:27 +0000 (16:08 +0200)
src/decode.c

index a8c0afc..22487fd 100644 (file)
                           data = d;                                     \
                       }                                                 \
                   } else {                                              \
-                      if (half_d <= xmax - data) {                      \
+                      /*in this case (xmax - data == xmax ^ data)*/     \
+                      if (half_d <= (xmax ^ data)) {                    \
                           data += (d >> 1)^(~((d & 1) - 1));            \
                       } else {                                          \
-                          data = xmax - d;                              \
+                          data = xmax ^ d;                              \
                       }                                                 \
                   }                                                     \
                   put_##KIND(strm, (uint32_t)data);                     \