mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Move containsObject: to NSOrderedSet.m. Make additional changes to fix issues pointed out by Fred
This commit is contained in:
parent
c131f7ec34
commit
abe0ee3d3d
2 changed files with 9 additions and 21 deletions
|
@ -218,22 +218,6 @@ static Class mutableSetClass;
|
|||
return item.obj;
|
||||
}
|
||||
|
||||
- (BOOL) containsObject: (id)anObject
|
||||
{
|
||||
NSUInteger i = 0;
|
||||
|
||||
for (i = 0; i < [self count]; i++)
|
||||
{
|
||||
id obj = [self objectAtIndex: i];
|
||||
if([anObject isEqual: obj])
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
/* Designated initialiser */
|
||||
- (id) initWithObjects: (const id*)objs count: (NSUInteger)c
|
||||
{
|
||||
|
@ -308,6 +292,7 @@ static Class mutableSetClass;
|
|||
|
||||
- (void) removeObjectAtIndex: (NSUInteger)index
|
||||
{
|
||||
_version++;
|
||||
GSIArrayRemoveItemAtIndex(&array, index);
|
||||
}
|
||||
|
||||
|
|
|
@ -629,12 +629,16 @@ static SEL rlSel;
|
|||
return 0;
|
||||
}
|
||||
|
||||
- (BOOL)containsObject:(id)anObject // required override
|
||||
- (BOOL) containsObject: (id)anObject
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return NO;
|
||||
NSUInteger i = [self indexOfObject: anObject];
|
||||
if (i == NSNotFound)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
- (void) enumerateObjectsAtIndexes:(NSIndexSet *)indexSet
|
||||
options:(NSEnumerationOptions)opts
|
||||
usingBlock:(GSEnumeratorBlock)aBlock
|
||||
|
@ -727,7 +731,6 @@ static SEL rlSel;
|
|||
return GS_IMMUTABLE(group);
|
||||
}
|
||||
|
||||
|
||||
- (NSUInteger) indexOfObject:(id)anObject
|
||||
{
|
||||
NSUInteger c = [self count];
|
||||
|
|
Loading…
Reference in a new issue