diff options
author | Daniel Stone <daniel@fooishbar.org> | 2011-05-03 02:50:48 +0100 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-06 13:15:23 +1000 |
commit | b8540d18c7d3a0f93f9e2565a410986eddedcecb (patch) | |
tree | ca478221abbeb65fc462f2cc203cbee0829296d8 | |
parent | 72b6639c83df74767094a5e0c2861fdc5ea03ecd (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>
-rw-r--r-- | xkb/xkb.c | 29 |
1 files changed, 15 insertions, 14 deletions
@@ -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); } } |