@@ -218,10 +218,17 @@ str = [OFMutableString stringWithString: @""]; + /* + * 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. + */ + str->isa = [OFString class]; return str; } pool = [[OFAutoreleasePool alloc] init]; def_ns = (defaultNamespace != nil