]> wimlib.net Git - wimlib/blobdiff - src/list.h
Ugly hack
[wimlib] / src / list.h
index 82f08e5ff47e9e192777edfebc9358a590dcd119..ce2dad2c495d55910a935d4c27b0abba2cb5949a 100644 (file)
@@ -195,6 +195,16 @@ static inline void hlist_del(struct hlist_node *n)
                next->pprev = pprev;
 }
 
+static inline void hlist_safe_del(struct hlist_node *n)
+{
+       struct hlist_node *next = n->next;
+       struct hlist_node **pprev = n->pprev;
+       if (pprev)
+               *pprev = next;
+       if (next)
+               next->pprev = pprev;
+}
+
 static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
 {
        struct hlist_node *first = h->first;