summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMoritz Hanke <hanke@dkrz.de>2014-09-08 15:29:03 +0200
committerMathis Rosenhauer <rosenhauer@dkrz.de>2014-10-24 16:08:26 +0200
commitd010b55c7f8cd14d8103b9f29a064401ca9d548c (patch)
tree46796b2565c1a2c03b04d9f533300879b6a2b89a /src
parent5431e0eedf530262311697ee8f61e0db57116023 (diff)
downloadlibaec-d010b55c7f8cd14d8103b9f29a064401ca9d548c.tar.gz
libaec-d010b55c7f8cd14d8103b9f29a064401ca9d548c.tar.bz2
libaec-d010b55c7f8cd14d8103b9f29a064401ca9d548c.zip
replaces if statement in FLUSH with a little bit hack
Diffstat (limited to 'src')
-rw-r--r--src/decode.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/decode.c b/src/decode.c
index 3b3e743..820772e 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -102,19 +102,13 @@
\
if (data < med) { \
if (half_d <= data - xmin) { \
- if (d & 1) \
- data -= half_d; \
- else \
- data += half_d; \
+ data += (d >> 1)^(~((d & 1) - 1)); \
} else { \
data = xmin + d; \
} \
} else { \
if (half_d <= xmax - data) { \
- if (d & 1) \
- data -= half_d; \
- else \
- data += half_d; \
+ data += (d >> 1)^(~((d & 1) - 1)); \
} else { \
data = xmax - d; \
} \