浏览代码

improve NAME_multilist_alone_MEMBER so it works just the same with attached lists

Samuel Thibault 7 年之前
父节点
当前提交
152f70a5a4
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/common/list.h

+ 2 - 2
src/common/list.h

@@ -349,9 +349,9 @@ LIST_INLINE int ENAME##_multilist_empty_##MEMBER(struct ENAME##_multilist_##MEMB
 	return head->next == head; \
 	return head->next == head; \
 } \
 } \
 \
 \
-/* Test whether the element is alone in a detached list.  */ \
+/* Test whether the element is alone in a list.  */ \
 LIST_INLINE int ENAME##_multilist_alone_##MEMBER(TYPE *e) { \
 LIST_INLINE int ENAME##_multilist_alone_##MEMBER(TYPE *e) { \
-	return (e)->MEMBER.next == &e->MEMBER && (e)->MEMBER.prev == &(e)->MEMBER; \
+	return (e)->MEMBER.next == (e)->MEMBER.prev; \
 } \
 } \
 \
 \
 /* Return the first element of the list.  */ \
 /* Return the first element of the list.  */ \