From: Moritz Hanke Date: Tue, 9 Sep 2014 14:56:05 +0000 (+0200) Subject: replaces subtraction with XOR in FLUSH X-Git-Tag: accepted/tizen/5.0/unified/20181102.025501~49 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e601c7d8712fca7a3b6e1b8e89ea2b7b0bd08a26;p=platform%2Fupstream%2Flibaec.git replaces subtraction with XOR in FLUSH --- 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); \