@@ -213,18 +213,14 @@ } [ret replaceOccurrencesOfString: @"\n" withString: @"\n\t"]; [ret appendString: @"\n)}"]; + [ret makeImmutable]; + [pool release]; - /* - * Class swizzle the string to be immutable. We declared the return type - * to be OFString*, so it can't be modified anyway. But not swizzling it - * would create a real copy each time -[copy] is called. - */ - ret->isa = [OFString class]; return ret; } - copy { @@ -313,15 +309,11 @@ BOOL *stop) { if (block(key)) [ret addObject: key]; }]; - /* - * Class swizzle the set to be immutable. We declared the return type - * to be OFSet*, so it can't be modified anyway. But not swizzling it - * would create a real copy each time -[copy] is called. - */ - ret->isa = [OFSet class]; + [ret makeImmutable]; + return ret; } #endif @end