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>
This commit is contained in:
Daniel Stone 2011-05-03 02:50:48 +01:00 committed by Peter Hutterer
parent 72b6639c83
commit b8540d18c7

View File

@ -5870,7 +5870,9 @@ 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 && GetMaster(tmpd, MASTER_KEYBOARD) != dev)
continue;
if (tmpd != dev)
XkbCopyDeviceKeymap(tmpd, dev);
@ -5886,7 +5888,6 @@ ProcXkbGetKbdByName(ClientPtr client)
XkbFreeSrvLedInfo(old_sli);
}
}
}
nkn.deviceID= nkn.oldDeviceID= dev->id;
nkn.minKeyCode= new->min_key_code;