aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/list.c7
-rw-r--r--include/list.h1
-rw-r--r--sway/desktop/transaction.c2
3 files changed, 1 insertions, 9 deletions
diff --git a/common/list.c b/common/list.c
index cab10c1e..39cc10e1 100644
--- a/common/list.c
+++ b/common/list.c
@@ -62,13 +62,6 @@ void list_cat(list_t *list, list_t *source) {
62 } 62 }
63} 63}
64 64
65void list_empty(list_t *list) {
66 list->capacity = 10;
67 list->length = 0;
68 free(list->items);
69 list->items = malloc(sizeof(void*) * list->capacity);
70}
71
72void list_qsort(list_t *list, int compare(const void *left, const void *right)) { 65void list_qsort(list_t *list, int compare(const void *left, const void *right)) {
73 qsort(list->items, list->length, sizeof(void *), compare); 66 qsort(list->items, list->length, sizeof(void *), compare);
74} 67}
diff --git a/include/list.h b/include/list.h
index d352dbd5..7eead4ac 100644
--- a/include/list.h
+++ b/include/list.h
@@ -14,7 +14,6 @@ void list_add(list_t *list, void *item);
14void list_insert(list_t *list, int index, void *item); 14void list_insert(list_t *list, int index, void *item);
15void list_del(list_t *list, int index); 15void list_del(list_t *list, int index);
16void list_cat(list_t *list, list_t *source); 16void list_cat(list_t *list, list_t *source);
17void list_empty(list_t *list);
18// See qsort. Remember to use *_qsort functions as compare functions, 17// See qsort. Remember to use *_qsort functions as compare functions,
19// because they dereference the left and right arguments first! 18// because they dereference the left and right arguments first!
20void list_qsort(list_t *list, int compare(const void *left, const void *right)); 19void list_qsort(list_t *list, int compare(const void *left, const void *right));
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index 7a2e78e5..fc23ef35 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -241,7 +241,7 @@ static void transaction_progress_queue() {
241 transaction_apply(transaction); 241 transaction_apply(transaction);
242 transaction_destroy(transaction); 242 transaction_destroy(transaction);
243 } 243 }
244 list_empty(server.transactions); 244 server.transactions->length = 0;
245} 245}
246 246
247static int handle_timeout(void *data) { 247static int handle_timeout(void *data) {