Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -225,10 +225,12 @@ size_t i, count = [array count]; IMP append; if (count == 0) return @""; + if (count == 1) + return [objs[0] retain]; str = [OFMutableString string]; append = [str methodForSelector: @selector(appendString:)]; for (i = 0; i < count - 1; i++) { Index: tests/OFArray.m ================================================================== --- tests/OFArray.m +++ tests/OFArray.m @@ -116,13 +116,15 @@ OFOutOfRangeException, [a[0] objectAtIndex: [a[0] count]]) EXPECT_EXCEPTION(@"Detect out of range in -[removeNItems:]", OFOutOfRangeException, [m[0] removeNObjects: [m[0] count] + 1]) - a[1] = [OFArray arrayWithObjects: @"foo", @"bar", @"baz", nil]; TEST(@"-[componentsJoinedByString:]", - [[a[1] componentsJoinedByString: @" "] isEqual: @"foo bar baz"]) + (a[1] = [OFArray arrayWithObjects: @"foo", @"bar", @"baz", nil]) && + [[a[1] componentsJoinedByString: @" "] isEqual: @"foo bar baz"] && + (a[1] = [OFArray arrayWithObject: @"foo"]) && + [[a[1] componentsJoinedByString: @" "] isEqual: @"foo"]) m[0] = [[a[0] mutableCopy] autorelease]; ok = YES; i = 0;