mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Fix -[NSCharacterSet invertedSet] to work by calling -invert on a mutable copy
This commit is contained in:
parent
d4dc2dafc9
commit
dcfe2a2ce3
2 changed files with 36 additions and 13 deletions
|
@ -1050,25 +1050,21 @@ static Class concreteMutableClass = nil;
|
|||
|
||||
- (NSCharacterSet*) invertedSet
|
||||
{
|
||||
unsigned i;
|
||||
unsigned length;
|
||||
unsigned char *bytes;
|
||||
NSMutableData *bitmap;
|
||||
NSMutableCharacterSet *m = [self mutableCopy];
|
||||
NSCharacterSet *c;
|
||||
|
||||
bitmap = AUTORELEASE([[self bitmapRepresentation] mutableCopy]);
|
||||
length = [bitmap length];
|
||||
bytes = [bitmap mutableBytes];
|
||||
for (i = 0; i < length; i++)
|
||||
{
|
||||
bytes[i] = ~bytes[i];
|
||||
}
|
||||
return [[self class] characterSetWithBitmapRepresentation: bitmap];
|
||||
[m invert];
|
||||
c = [m copy];
|
||||
RELEASE(m);
|
||||
return AUTORELEASE(c);
|
||||
}
|
||||
|
||||
- (BOOL) isEqual: (id)anObject
|
||||
{
|
||||
if (anObject == self)
|
||||
return YES;
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
if ([anObject isKindOfClass: abstractClass])
|
||||
{
|
||||
unsigned i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue