From e601c7d8712fca7a3b6e1b8e89ea2b7b0bd08a26 Mon Sep 17 00:00:00 2001 From: Moritz Hanke Date: Tue, 9 Sep 2014 16:56:05 +0200 Subject: [PATCH] replaces subtraction with XOR in FLUSH --- src/decode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/decode.c b/src/decode.c index a8c0afc..22487fd 100644 --- a/src/decode.c +++ b/src/decode.c @@ -105,10 +105,11 @@ 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); \ -- 2.7.4