ObjFW  Diff

Differences From Artifact [beb073a948]:

To Artifact [7dc1c308f0]:


144
145
146
147
148
149
150




151
152
153
154
155
156
157
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161







+
+
+
+







	  forKey: (id <OFCopying>)key
{
	self = [super init];

	@try {
		uint32_t i;
		BUCKET *b;

		if (key == nil || object == nil)
			@throw [OFInvalidArgumentException newWithClass: isa
							       selector: _cmd];

		data = [self allocMemoryForNItems: 2
					 withSize: sizeof(BUCKET*)];

		size = 2;
		for (i = 0; i < size; i++)
			data[i] = NULL;
704
705
706
707
708
709
710
711
712



713
714
715
716
717

718

719
720
721

722
723
724
725
726
727
728
708
709
710
711
712
713
714


715
716
717
718
719
720
721
722
723

724
725
726

727
728
729
730
731
732
733
734







-
-
+
+
+





+
-
+


-
+







	return hash;
}

- (OFString*)description
{
	OFMutableString *ret = [OFMutableString stringWithString: @"{\n"];
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init], *pool2;
	OFEnumerator *enumerator = [self keyEnumerator];
	id key;
	OFEnumerator *keyEnumerator = [self keyEnumerator];
	OFEnumerator *objectEnumerator = [self objectEnumerator];
	id key, object;
	size_t i;

	i = 0;
	pool2 = [[OFAutoreleasePool alloc] init];

	while ((key = [keyEnumerator nextObject]) != nil &&
	while ((key = [enumerator nextObject]) != nil) {
	    (object = [objectEnumerator nextObject]) != nil) {
		[ret appendString: [key description]];
		[ret appendString: @" = "];
		[ret appendString: [[self objectForKey: key] description]];
		[ret appendString: [object description]];

		if (++i < count)
			[ret appendString: @";\n"];

		[pool2 releaseObjects];
	}
	[ret replaceOccurrencesOfString: @"\n"