@@ -24,21 +24,10 @@ - init { self = [super init]; - first = NULL; - last = NULL; - retain_and_release = YES; - - return self; -} - -- initWithoutRetainAndRelease -{ - self = [super init]; - first = NULL; last = NULL; return self; } @@ -79,12 +68,11 @@ if (first == NULL) first = o; count++; - if (retain_and_release) - [obj retain]; + [obj retain]; return o; } - (of_list_object_t*)prepend: (id)obj @@ -103,12 +91,11 @@ if (last == NULL) last = o; count++; - if (retain_and_release) - [obj retain]; + [obj retain]; return o; } - (of_list_object_t*)insert: (id)obj @@ -129,12 +116,11 @@ if (listobj == first) first = o; count++; - if (retain_and_release) - [obj retain]; + [obj retain]; return o; } - (of_list_object_t*)insert: (id)obj @@ -155,12 +141,11 @@ if (listobj == last) last = o; count++; - if (retain_and_release) - [obj retain]; + [obj retain]; return o; } - remove: (of_list_object_t*)listobj @@ -175,12 +160,11 @@ if (last == listobj) last = listobj->prev; count--; - if (retain_and_release) - [listobj->object release]; + [listobj->object release]; [self freeMemory: listobj]; return self; } @@ -211,18 +195,13 @@ return YES; } - (id)copy { - OFList *new; + OFList *new = [[OFList alloc] init]; of_list_object_t *iter, *o, *prev; - if (retain_and_release) - new = [[OFList alloc] init]; - else - new = [[OFList alloc] initWithoutRetainAndRelease]; - o = NULL; prev = NULL; @try { for (iter = first; iter != NULL; iter = iter->next) { @@ -236,12 +215,11 @@ if (prev != NULL) prev->next = o; new->count++; - if (retain_and_release) - [o->object retain]; + [o->object retain]; prev = o; } } @catch (OFException *e) { [new release];