diff options
Diffstat (limited to 'sway/tree/root.c')
-rw-r--r-- | sway/tree/root.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sway/tree/root.c b/sway/tree/root.c index 79f2194e..a974a461 100644 --- a/sway/tree/root.c +++ b/sway/tree/root.c | |||
@@ -84,11 +84,9 @@ void root_scratchpad_remove_container(struct sway_container *con) { | |||
84 | return; | 84 | return; |
85 | } | 85 | } |
86 | con->scratchpad = false; | 86 | con->scratchpad = false; |
87 | for (int i = 0; i < root_container.sway_root->scratchpad->length; ++i) { | 87 | int index = list_find(root_container.sway_root->scratchpad, con); |
88 | if (root_container.sway_root->scratchpad->items[i] == con) { | 88 | if (index != -1) { |
89 | list_del(root_container.sway_root->scratchpad, i); | 89 | list_del(root_container.sway_root->scratchpad, index); |
90 | break; | ||
91 | } | ||
92 | } | 90 | } |
93 | } | 91 | } |
94 | 92 | ||