From de4a08ace09a948d3f92bc999a835934b4593896 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 17 Oct 2019 08:39:40 +0300 Subject: [PATCH] sowm: avoid branch and variable. --- sowm.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sowm.c b/sowm.c index 853a25f..1e694eb 100644 --- a/sowm.c +++ b/sowm.c @@ -199,12 +199,9 @@ void notify_motion(XEvent *e) { managers happens here. */ void key_grab() { - KeyCode code; - for (unsigned int i=0; i < sizeof(keys)/sizeof(*keys); ++i) - if ((code = XKeysymToKeycode(d, keys[i].keysym))) - XGrabKey(d, code, keys[i].mod, root, - True, GrabModeAsync, GrabModeAsync); + XGrabKey(d, XKeysymToKeycode(d, keys[i].keysym), keys[i].mod, + root, True, GrabModeAsync, GrabModeAsync); } /*