ObjFW  Diff

Differences From Artifact [58353278e7]:

To Artifact [d37721f3e3]:


274
275
276
277
278
279
280
281
282
283

284
285

286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
274
275
276
277
278
279
280



281


282





283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302











303
304
305
306
307
308
309







-
-
-
+
-
-
+
-
-
-
-
-




















-
-
-
-
-
-
-
-
-
-
-







	return [self objectAtIndex: idx];
}

- (id)valueForKey: (OFString *)key
{
	id ret;

	if ([key hasPrefix: @"@"]) {
		void *pool = objc_autoreleasePoolPush();

	if ([key isEqual: @"@count"])
		key = [key substringWithRange: of_range(1, key.length - 1)];
		ret = [[super valueForKey: key] retain];
		return [super valueForKey: @"count"];

		objc_autoreleasePoolPop(pool);

		return [ret autorelease];
	}

	ret = [OFMutableArray arrayWithCapacity: self.count];

	for (id object in self) {
		id value = [object valueForKey: key];

		if (value == nil)
			value = [OFNull null];

		[ret addObject: value];
	}

	[ret makeImmutable];

	return ret;
}

- (void)setValue: (id)value
	  forKey: (OFString *)key
{
	if ([key hasPrefix: @"@"]) {
		void *pool = objc_autoreleasePoolPush();

		key = [key substringWithRange: of_range(1, key.length - 1)];
		[super setValue: value
			 forKey: key];

		objc_autoreleasePoolPop(pool);
		return;
	}

	for (id object in self)
		[object setValue: value
			  forKey: key];
}

- (size_t)indexOfObject: (id)object
{