diff options
author | Ian Fan <ianfan0@gmail.com> | 2018-12-08 23:55:14 +0000 |
---|---|---|
committer | Ian Fan <ianfan0@gmail.com> | 2018-12-09 01:15:38 +0000 |
commit | c8776fac4232f9faab0a78ef3e18dc4366496421 (patch) | |
tree | 028fbc584d233a7a934feb0b6807c9a988c8e7f1 /sway/config.c | |
parent | 19e831ed3da2aba75d56e46c57967bcc60442d57 (diff) |
Cleanup list code
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sway/config.c b/sway/config.c index efb95e31..4621cad9 100644 --- a/sway/config.c +++ b/sway/config.c @@ -38,26 +38,24 @@ struct sway_config *config = NULL; static void free_mode(struct sway_mode *mode) { - int i; - if (!mode) { return; } free(mode->name); if (mode->keysym_bindings) { - for (i = 0; i < mode->keysym_bindings->length; i++) { + for (int i = 0; i < mode->keysym_bindings->length; i++) { free_sway_binding(mode->keysym_bindings->items[i]); } list_free(mode->keysym_bindings); } if (mode->keycode_bindings) { - for (i = 0; i < mode->keycode_bindings->length; i++) { + for (int i = 0; i < mode->keycode_bindings->length; i++) { free_sway_binding(mode->keycode_bindings->items[i]); } list_free(mode->keycode_bindings); } if (mode->mouse_bindings) { - for (i = 0; i < mode->mouse_bindings->length; i++) { + for (int i = 0; i < mode->mouse_bindings->length; i++) { free_sway_binding(mode->mouse_bindings->items[i]); } list_free(mode->mouse_bindings); |