summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-04-20 15:30:19 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-04-21 14:21:30 +1000
commit8ae90552f95f025ad09a17258d56603a424ca076 (patch)
tree7ee6a54fda6663d1ce478f9b92b4f98249381cf7
parentc45f4cc6bd885855ecb54d9113010906d9ee58e2 (diff)
dix: use single return statement in ApplySimpleSoftening
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
-rw-r--r--dix/ptrveloc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index 304a1c92e..98468bc8e 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -697,12 +697,13 @@ static inline float
ApplySimpleSoftening(int prev_delta, int delta)
{
float result = delta;
- if (delta <= 1 && delta >= -1)
- return result;
- if (delta > prev_delta)
- result -= 0.5;
- else if (delta < prev_delta)
- result += 0.5;
+
+ if (delta < -1 || delta > 1) {
+ if (delta > prev_delta)
+ result -= 0.5;
+ else if (delta < prev_delta)
+ result += 0.5;
+ }
return result;
}