ObjFW  Check-in [50d2bd5dec]

Overview
Comment:Improve -[OFDictionary isEqual:].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 50d2bd5dec885e9df1b42e6210e75ac292dbb946d9abc6af9b4a4844b1f204df
User & Date: js on 2012-03-13 20:19:52
Other Links: manifest | tags
Context
2012-03-14
09:03
Update buildsys. check-in: fdff9737f0 user: js tags: trunk
2012-03-13
20:19
Improve -[OFDictionary isEqual:]. check-in: 50d2bd5dec user: js tags: trunk
20:19
Add of_num_cpus. check-in: 5a7c58ec98 user: js tags: trunk
Changes

Modified src/OFDictionary.m from [d4934d5b93] to [e60712dc03].

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
}

- mutableCopy
{
	return [[OFMutableDictionary alloc] initWithDictionary: self];
}

- (BOOL)isEqual: (id)dictionary
{

	OFAutoreleasePool *pool;
	OFEnumerator *enumerator;
	id key;






	if ([dictionary count] != [self count])
		return NO;

	pool = [[OFAutoreleasePool alloc] init];

	enumerator = [self keyEnumerator];
	while ((key = [enumerator nextObject]) != nil) {
		id object = [dictionary objectForKey: key];

		if (object == nil ||
		    ![object isEqual: [self objectForKey: key]]) {
			[pool release];
			return NO;
		}
	}







|

>




>
>
>
>
>
|






|







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
}

- mutableCopy
{
	return [[OFMutableDictionary alloc] initWithDictionary: self];
}

- (BOOL)isEqual: (id)object
{
	OFDictionary *otherDictionary;
	OFAutoreleasePool *pool;
	OFEnumerator *enumerator;
	id key;

	if (![object isKindOfClass: [OFDictionary class]])
		return NO;

	otherDictionary = object;

	if ([otherDictionary count] != [self count])
		return NO;

	pool = [[OFAutoreleasePool alloc] init];

	enumerator = [self keyEnumerator];
	while ((key = [enumerator nextObject]) != nil) {
		id object = [otherDictionary objectForKey: key];

		if (object == nil ||
		    ![object isEqual: [self objectForKey: key]]) {
			[pool release];
			return NO;
		}
	}