Improve code of func "wintoclient"

This commit is contained in:
Alex Kotov 2021-11-20 22:15:54 +05:00
parent 16ff36d67b
commit 8d0b890b49
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
1 changed files with 7 additions and 6 deletions

View File

@ -1727,13 +1727,14 @@ void updatewmhints(Client *c)
Client *wintoclient(Window w)
{
Client *c;
Monitor *m;
for (m = mons; m; m = m->next)
for (c = m->clients; c; c = c->next)
if (c->win == w)
for (Monitor *m = mons; m; m = m->next) {
for (Client *c = m->clients; c; c = c->next) {
if (c->win == w) {
return c;
}
}
}
return NULL;
}