summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-05-20 14:38:25 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-05-20 16:22:24 +1000
commit42719ce5c715ac3a0c74c3c7df872d35e0449de9 (patch)
tree59dfec10bb8c09ec091b33d1c3b6bbb4f2d4a143 /dix
parentb89dcfbfbd38f8d19f1d4f24f81820b1048572c8 (diff)
dix: remove superfluous loop in change_modmap.
A device can only be attached to a single master device. So instead of looping and searching for the master device, we can just use dev->u.master directly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix')
-rw-r--r--dix/inpututils.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/dix/inpututils.c b/dix/inpututils.c
index c6300880b..152214506 100644
--- a/dix/inpututils.c
+++ b/dix/inpututils.c
@@ -275,14 +275,10 @@ change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *modkeymap,
do_modmap_change(client, tmp, modmap);
}
}
- else {
- for (tmp = inputInfo.devices; tmp; tmp = tmp->next) {
- if (tmp->isMaster && tmp->u.lastSlave == dev) {
- /* If this fails, expect the results to be weird. */
- if (check_modmap_change(client, tmp, modmap))
- do_modmap_change(client, tmp, modmap);
- }
- }
+ else if (dev->u.master && dev->u.master->u.lastSlave == dev) {
+ /* If this fails, expect the results to be weird. */
+ if (check_modmap_change(client, dev->u.master, modmap))
+ do_modmap_change(client, dev->u.master, modmap);
}
return Success;