Commit b8540d18 authored by Daniel Stone's avatar Daniel Stone Committed by Peter Hutterer

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: 's avatarDaniel Stone <daniel@fooishbar.org>
Reviewed-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 72b6639c
......@@ -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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment