From e6df411cf58d9c26166a9d6b27803ac239b5a81b Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 1 Apr 2025 16:06:49 +0200 Subject: [PATCH] XI: drop extra temp variable in ProcXGetDeviceMotionEvents() The value is only checked once, so no need to copy it to a temporary variable first. Signed-off-by: Enrico Weigelt, metux IT consult --- Xi/gtmotion.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Xi/gtmotion.c b/Xi/gtmotion.c index e24dbd769..ba295ed00 100644 --- a/Xi/gtmotion.c +++ b/Xi/gtmotion.c @@ -87,7 +87,7 @@ int ProcXGetDeviceMotionEvents(ClientPtr client) { INT32 *coords = NULL; - int rc, num_events, axes, size = 0; + int rc, axes, size = 0; DeviceIntPtr dev; TimeStamp start, stop; ValuatorClassPtr v; @@ -124,8 +124,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client) } if (CompareTimeStamps(stop, currentTime) == LATER) stop = currentTime; - num_events = v->numMotionEvents; - if (num_events) { + if (v->numMotionEvents) { size = sizeof(Time) + (axes * sizeof(INT32)); rep.nEvents = GetMotionHistory(dev, (xTimecoord **) &coords, /* XXX */ start.milliseconds, stop.milliseconds,