summaryrefslogtreecommitdiff
path: root/xkb
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2011-05-03 02:50:48 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2011-05-06 13:15:23 +1000
commitb8540d18c7d3a0f93f9e2565a410986eddedcecb (patch)
treeca478221abbeb65fc462f2cc203cbee0829296d8 /xkb
parent72b6639c83df74767094a5e0c2861fdc5ea03ecd (diff)
XKB: Simplify a loop in ProcXkbGetKbdByName
Replace: for (stuff; things; etc) { if (misc || other) { [...] } } with: for (stuff; things; etc) { if (!misc && !other) continue; [...] } Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb')
-rw-r--r--xkb/xkb.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/xkb/xkb.c b/xkb/xkb.c
index c4cb74015..e17e216c1 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -5870,21 +5870,22 @@ ProcXkbGetKbdByName(ClientPtr client)
xkb->ctrls->num_groups= nTG;
for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) {
- if ((tmpd == dev) || (!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) {
- if (tmpd != dev)
- XkbCopyDeviceKeymap(tmpd, dev);
-
- if (tmpd->kbdfeed && tmpd->kbdfeed->xkb_sli) {
- old_sli = tmpd->kbdfeed->xkb_sli;
- tmpd->kbdfeed->xkb_sli = NULL;
- sli = XkbAllocSrvLedInfo(tmpd, tmpd->kbdfeed, NULL, 0);
- if (sli) {
- sli->explicitState = old_sli->explicitState;
- sli->effectiveState = old_sli->effectiveState;
- }
- tmpd->kbdfeed->xkb_sli = sli;
- XkbFreeSrvLedInfo(old_sli);
+ if (tmpd != dev && GetMaster(tmpd, MASTER_KEYBOARD) != dev)
+ continue;
+
+ if (tmpd != dev)
+ XkbCopyDeviceKeymap(tmpd, dev);
+
+ if (tmpd->kbdfeed && tmpd->kbdfeed->xkb_sli) {
+ old_sli = tmpd->kbdfeed->xkb_sli;
+ tmpd->kbdfeed->xkb_sli = NULL;
+ sli = XkbAllocSrvLedInfo(tmpd, tmpd->kbdfeed, NULL, 0);
+ if (sli) {
+ sli->explicitState = old_sli->explicitState;
+ sli->effectiveState = old_sli->effectiveState;
}
+ tmpd->kbdfeed->xkb_sli = sli;
+ XkbFreeSrvLedInfo(old_sli);
}
}