From: Eric Biggers Date: Thu, 2 Jul 2015 23:44:48 +0000 (-0500) Subject: Use list_replace() instead of list_transfer() X-Git-Tag: v1.8.2~46 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=a941f876cf6795a1e0bc634991712747ca5ddeda;hp=31dcd352caa17f61fe1307738c2a24ed83f1d281;ds=sidebyside Use list_replace() instead of list_transfer() --- diff --git a/include/wimlib/list.h b/include/wimlib/list.h index f59e113c..d556a56c 100644 --- a/include/wimlib/list.h +++ b/include/wimlib/list.h @@ -140,24 +140,6 @@ list_splice(const struct list_head *list, struct list_head *head) __list_splice(list, head, head->next); } -/* Move the entire list @old to the list @new, overwriting it. */ -static inline void -list_transfer(struct list_head *old, struct list_head *new) -{ - struct list_head *prev, *next; - - if (list_empty(old)) { - INIT_LIST_HEAD(new); - } else { - prev = old->prev; - next = old->next; - new->next = next; - new->prev = prev; - prev->next = new; - next->prev = new; - } -} - /** * list_move - delete from one list and add as another's head * @list: the entry to move diff --git a/src/split.c b/src/split.c index 3f4a7d0a..6124a67d 100644 --- a/src/split.c +++ b/src/split.c @@ -44,7 +44,7 @@ struct swm_part_info { static void copy_part_info(struct swm_part_info *dst, struct swm_part_info *src) { - list_transfer(&src->blob_list, &dst->blob_list); + list_replace(&src->blob_list, &dst->blob_list); dst->size = src->size; }