@@ -1581,17 +1581,11 @@ } [array addObject: [OFString stringWithCString: s->cString + last]]; [pool release]; - /* - * Class swizzle the array to be immutable. We declared the return type - * to be OFArray*, so it can't be modified anyway. But not swizzling it - * would create a real copy each time -[copy] is called. - */ - array->isa = [OFArray class]; - return array; + return [array makeImmutable]; } - (OFArray*)pathComponents { OFMutableArray *ret; @@ -1629,17 +1623,11 @@ [ret addObject: [OFString stringWithCString: s->cString + last length: i - last]]; [pool release]; - /* - * Class swizzle the array to be immutable. We declared the return type - * to be OFArray*, so it can't be modified anyway. But not swizzling it - * would create a real copy each time -[copy] is called. - */ - ret->isa = [OFArray class]; - return ret; + return [ret makeImmutable]; } - (OFString*)lastPathComponent { size_t pathCStringLength = s->cStringLength;