moused: Omit superfluous gettimeofday calls when mouse only moves
authorImre Vadasz <imre@vdsz.com>
Thu, 24 Dec 2015 11:50:37 +0000 (12:50 +0100)
committerImre Vadász <imre@vdsz.com>
Thu, 24 Dec 2015 12:30:49 +0000 (13:30 +0100)
The gettimeofday() is only needed when a mouse button state changed.

usr.sbin/moused/moused.c

index b41cc23..054c0d8 100644 (file)
@@ -2327,10 +2327,8 @@ r_timestamp(mousestatus_t *act)
     int i;
 
     mask = act->flags & MOUSE_BUTTONS;
-#if 0
     if (mask == 0)
        return;
-#endif
 
     gettimeofday(&tv1, NULL);