diff --git a/headers/private/kernel/util/DoublyLinkedList.h b/headers/private/kernel/util/DoublyLinkedList.h index bd306e16cd..239f0b0c63 100644 --- a/headers/private/kernel/util/DoublyLinkedList.h +++ b/headers/private/kernel/util/DoublyLinkedList.h @@ -69,7 +69,7 @@ class List { IteratorType Iterator() { - return IteratorType(this); + return IteratorType(*this); } bool IsEmpty() @@ -82,7 +82,6 @@ class List { return fLink.next; } - static inline size_t Offset() { return (size_t)&(((Item *)1)->*LinkMember) - 1; @@ -104,11 +103,11 @@ class Iterator { typedef List ListType; Iterator() : fCurrent(NULL) {} - Iterator(ListType &list) : fList(list), fCurrent(list.Head()) {} + Iterator(ListType &list) : fList(&list), fCurrent(list.Head()) {} Item *Next() { - if (fCurrent == &fList.fLink) + if (fCurrent == &fList->fLink) return NULL; Link *current = fCurrent; @@ -118,7 +117,7 @@ class Iterator { } private: - ListType &fList; + ListType *fList; Link *fCurrent; };