Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -396,13 +396,17 @@ return hash; } - (OFString*)description { - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + OFAutoreleasePool *pool; OFMutableString *ret; + if ([array count] == 0) + return @"()"; + + pool = [[OFAutoreleasePool alloc] init]; ret = [[self componentsJoinedByString: @",\n"] mutableCopy]; @try { [ret prependString: @"(\n"]; [ret replaceOccurrencesOfString: @"\n" Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -708,17 +708,25 @@ return hash; } - (OFString*)description { - OFMutableString *ret = [OFMutableString stringWithString: @"{\n"]; - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init], *pool2; - OFEnumerator *keyEnumerator = [self keyEnumerator]; - OFEnumerator *objectEnumerator = [self objectEnumerator]; + OFMutableString *ret; + OFAutoreleasePool *pool, *pool2; + OFEnumerator *keyEnumerator; + OFEnumerator *objectEnumerator; id key, object; size_t i; + if (count == 0) + return @"{}"; + + ret = [OFMutableString stringWithString: @"{\n"]; + pool = [[OFAutoreleasePool alloc] init]; + keyEnumerator = [self keyEnumerator]; + objectEnumerator = [self objectEnumerator]; + i = 0; pool2 = [[OFAutoreleasePool alloc] init]; while ((key = [keyEnumerator nextObject]) != nil && (object = [objectEnumerator nextObject]) != nil) { Index: src/OFList.m ================================================================== --- src/OFList.m +++ src/OFList.m @@ -284,14 +284,18 @@ return hash; } - (OFString*)description { - OFMutableString *ret = [OFMutableString stringWithString: @"[\n"]; + OFMutableString *ret; OFAutoreleasePool *pool; of_list_object_t *iter; + if (count == 0) + return @"[]"; + + ret = [OFMutableString stringWithString: @"[\n"]; pool = [[OFAutoreleasePool alloc] init]; for (iter = firstListObject; iter != NULL; iter = iter->next) { [ret appendString: [iter->object description]];