summaryrefslogtreecommitdiff
path: root/src/decode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/decode.c')
-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; \
} \