ObjFW  Diff

Differences From Artifact [e74beec694]:

To Artifact [da98a6238c]:


149
150
151
152
153
154
155
156

157
158
159

160
161

162
163
164

165
166
167
168
169
170
171
149
150
151
152
153
154
155

156
157
158

159
160

161
162
163

164
165
166
167
168
169
170
171







-
+


-
+

-
+


-
+







	return [self retain];
}

- (id)mutableCopy
{
	OFArray *new = [[OFMutableArray alloc] init];
	OFObject **objs;
	size_t len, i;
	size_t count, i;

	objs = [array cArray];
	len = [array count];
	count = [array count];

	[new->array addNItems: len
	[new->array addNItems: count
		   fromCArray: objs];

	for (i = 0; i < len; i++)
	for (i = 0; i < count; i++)
		[objs[i] retain];

	return new;
}

- (id)objectAtIndex: (size_t)index
{
215
216
217
218
219
220
221
222

223
224
225
226
227
228


229
230

231
232
233
234
235
236

237
238
239
240
241
242
243
215
216
217
218
219
220
221

222
223
224
225
226


227
228
229

230
231
232
233
234
235

236
237
238
239
240
241
242
243







-
+




-
-
+
+

-
+





-
+








	return (last != NULL ? *last : nil);
}

- (BOOL)isEqual: (id)obj
{
	OFObject **objs, **objs2;
	size_t i, len, len2;
	size_t i, count, count2;

	if (![obj isKindOfClass: [OFArray class]])
		return NO;

	len = [array count];
	len2 = [obj count];
	count = [array count];
	count2 = [obj count];

	if (len != len2)
	if (count != count2)
		return NO;

	objs = [array cArray];
	objs2 = [obj cArray];

	for (i = 0; i < len; i++)
	for (i = 0; i < count; i++)
		if (![objs[i] isEqual: objs2[i]])
			return NO;

	return YES;
}

- (uint32_t)hash
260
261
262
263
264
265
266
267

268
269
270
271
272

273
274
275


276
277

278
279
280
281
282
283












284
285
286
287
288
289
290
260
261
262
263
264
265
266

267





268
269


270
271
272

273

274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297







-
+
-
-
-
-
-
+

-
-
+
+

-
+
-





+
+
+
+
+
+
+
+
+
+
+
+







	OF_HASH_FINALIZE(hash);

	return hash;
}

- (void)dealloc
{
	OFObject **objs;
	OFObject **objs = [array cArray];
	size_t len, i;

	if (array != nil) {
		objs = [array cArray];
		len = [array count];
	size_t i, count = [array count];

		for (i = 0; i < len; i++)
			[objs[i] release];
	for (i = 0; i < count; i++)
		[objs[i] release];

		[array release];
	[array release];
	}

	[super dealloc];
}

- addObject: (OFObject*)obj
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
}

- removeObject: (id)obj
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
}

- removeObjectIdenticalTo: (id)obj
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
}

- removeObjectAtIndex: (size_t)index
{