summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2017-03-27 11:07:27 +0200
committerSander Vrijders <[email protected]>2017-03-28 10:24:54 +0200
commit53384bdca4f5e80f626e68e71ad2b82100b22735 (patch)
tree921c01fba6e294c449fb4e51968a549650b229f0
parentc0bfc1752df3530570a24c930220b94a4e3afabb (diff)
downloadouroboros-53384bdca4f5e80f626e68e71ad2b82100b22735.tar.gz
ouroboros-53384bdca4f5e80f626e68e71ad2b82100b22735.zip
lib: Revise list_move operation
This revises the list_move operation, which was giving weird behaviour.
-rw-r--r--src/lib/list.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/lib/list.c b/src/lib/list.c
index b6b4bbd2..52270fe8 100644
--- a/src/lib/list.c
+++ b/src/lib/list.c
@@ -71,13 +71,9 @@ bool list_is_empty(struct list_head * h)
return h->nxt == h;
}
-void list_move(struct list_head * dst,
- struct list_head * src)
+void list_move(struct list_head * n,
+ struct list_head * h)
{
- dst->nxt = src->nxt;
- dst->prv = src->prv;
- dst->nxt->prv = src->nxt->prv;
- dst->prv->nxt = src->prv->nxt;
-
- list_head_init(src);
+ del_list(n->prv, n->nxt);
+ list_add(n, h);
}