The deltatime variable is not used later so it can be reused for
calculations.
---
 x.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/x.c b/x.c
index 03f397f..0d9f48f 100644
--- a/x.c
+++ b/x.c
@@ -1936,16 +1936,11 @@ run(void)
                        xev--;
                if (!FD_ISSET(ttyfd, &rfd) && !FD_ISSET(xfd, &rfd)) {
                        if (blinkset) {
-                               if (TIMEDIFF(now, lastblink) \
-                                               > blinktimeout) {
-                                       drawtimeout.tv_nsec = 1000;
-                               } else {
-                                       drawtimeout.tv_nsec = (1E6 * \
-                                               (blinktimeout - \
-                                               TIMEDIFF(now, lastblink)));
-                               }
-                               drawtimeout.tv_sec = \
-                                       drawtimeout.tv_nsec / 1E9;
+                               deltatime = TIMEDIFF(now, lastblink);
+                               drawtimeout.tv_nsec = deltatime > blinktimeout
+                                       ? 1000
+                                       : 1E6 * (blinktimeout - deltatime);
+                               drawtimeout.tv_sec = drawtimeout.tv_nsec / 1E9;
                                drawtimeout.tv_nsec %= (long)1E9;
                        } else {
                                tv = NULL;
-- 
2.25.2


Reply via email to