ObjFW  Diff

Differences From Artifact [ca08344bc3]:

To Artifact [3dcb760b24]:


92
93
94
95
96
97
98


99
100
101
102
103
104
105
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107







+
+








	if (last != NULL)
		last->next = o;

	last = o;
	if (first == NULL)
		first = o;

	count++;

	if (retain_and_release)
		[obj retain];

	return o;
}

114
115
116
117
118
119
120


121
122
123
124
125
126
127
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131







+
+








	if (first != NULL)
		first->prev = o;

	first = o;
	if (last == NULL)
		last = o;

	count++;

	if (retain_and_release)
		[obj retain];

	return o;
}

138
139
140
141
142
143
144


145
146
147
148
149
150
151
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157







+
+







	if (listobj->prev != NULL)
		listobj->prev->next = o;

	listobj->prev = o;

	if (listobj == first)
		first = o;

	count++;

	if (retain_and_release)
		[obj retain];

	return o;
}

162
163
164
165
166
167
168


169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186


187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204

205
206
207
208
209
210
211
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207







208
209
210
211
212
213
214
215







+
+


















+
+











-
-
-
-
-
-
-
+







	if (listobj->next != NULL)
		listobj->next->prev = o;

	listobj->next = o;

	if (listobj == last)
		last = o;

	count++;

	if (retain_and_release)
		[obj retain];

	return o;
}

- remove: (of_list_object_t*)listobj
{
	if (listobj->prev != NULL)
		listobj->prev->next = listobj->next;
	if (listobj->next != NULL)
		listobj->next->prev = listobj->prev;

	if (first == listobj)
		first = listobj->next;
	if (last == listobj)
		last = listobj->prev;

	count--;

	if (retain_and_release)
		[listobj->object release];

	[self freeMemory: listobj];

	return self;
}

- (size_t)count
{
	size_t i;
	of_list_object_t *iter;

	for (i = 0, iter = first; iter != NULL; iter = iter->next)
		i++;

	return i;
	return count;
}

- (BOOL)isEqual: (id)obj
{
	of_list_object_t *iter, *iter2;

	if (![obj isKindOfClass: [OFList class]])
243
244
245
246
247
248
249



250
251
252
253
254
255
256
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263







+
+
+







			o->next = NULL;
			o->prev = prev;

			if (new->first == NULL)
				new->first = o;
			if (prev != NULL)
				prev->next = o;

			new->count++;

			if (retain_and_release)
				[o->object retain];

			prev = o;
		}
	} @catch (OFException *e) {
		[new release];