[PATCH 17/20] dix: use single return statement in ApplySimpleSoftening

Peter Hutterer peter.hutterer at who-t.net
Tue Apr 19 23:28:26 PDT 2011


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/ptrveloc.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index 6de02d2..8320834 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -701,12 +701,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;
 }
 
-- 
1.7.4.4



More information about the xorg-devel mailing list