diff options
author | Simon Ser <contact@emersion.fr> | 2024-02-27 12:30:03 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2024-03-06 14:18:37 +0100 |
commit | 440defbd2ba3379b0519ce4f0381bdbe181ce58d (patch) | |
tree | be71edcce811e8069584587544eea0bbbc957eae | |
parent | 7a1e7dd54963fad696aa7a1305440945ba3761d1 (diff) |
client: simplify create_proxies() loop
Decrease the indentation a bit. No functional change.
Signed-off-by: Simon Ser <contact@emersion.fr>
-rw-r--r-- | src/wayland-client.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/wayland-client.c b/src/wayland-client.c index 3e61dad..665fe55 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -1487,22 +1487,19 @@ create_proxies(struct wl_proxy *sender, struct wl_closure *closure) count = arg_count_for_signature(signature); for (i = 0; i < count; i++) { signature = get_next_argument(signature, &arg); - switch (arg.type) { - case WL_ARG_NEW_ID: - id = closure->args[i].n; - if (id == 0) { - closure->args[i].o = NULL; - break; - } - proxy = wl_proxy_create_for_id(sender, id, - closure->message->types[i]); - if (proxy == NULL) - return -1; - closure->args[i].o = (struct wl_object *)proxy; - break; - default: - break; + if (arg.type != WL_ARG_NEW_ID) + continue; + + id = closure->args[i].n; + if (id == 0) { + closure->args[i].o = NULL; + continue; } + proxy = wl_proxy_create_for_id(sender, id, + closure->message->types[i]); + if (proxy == NULL) + return -1; + closure->args[i].o = (struct wl_object *)proxy; } return 0; |