Re: [PATCH libinput 1/2] touchpad: Simplify tp_hysteresis

2014-06-30 Thread Peter Hutterer
On Mon, Jun 30, 2014 at 02:27:18PM +0200, Hans de Goede wrote: > Once we get beyond the: > > if (abs(diff) <= margin) > return center; > > test, then diff is either > margin or < -margin, otherwise the test would > have triggered. > > So the "return center + diff;" at the end

[PATCH libinput 1/2] touchpad: Simplify tp_hysteresis

2014-06-30 Thread Hans de Goede
Once we get beyond the: if (abs(diff) <= margin) return center; test, then diff is either > margin or < -margin, otherwise the test would have triggered. So the "return center + diff;" at the end will never be reached, and the "else if (diff < -margin)" can be turned into