@@ -9,10 +9,12 @@ * the packaging of this file. */ #include "config.h" +#include "assert.h" + #import "OFList.h" #import "OFExceptions.h" @implementation OFList + list @@ -212,19 +214,21 @@ { of_list_object_t *iter, *iter2; if (![obj isKindOfClass: [OFList class]]) return NO; + + if ([obj count] != count) + return NO; for (iter = first, iter2 = [obj first]; iter != NULL && iter2 != NULL; iter = iter->next, iter2 = iter2->next) if (![iter->object isEqual: iter2->object]) return NO; - /* One has still items */ - if (iter != NULL || iter2 != NULL) - return NO; + /* One is bigger than the other although we checked the count */ + assert(iter == NULL && iter2 == NULL); return YES; } - (id)copy