Move methods to abstract class. Implement setValue:...

This commit is contained in:
Gregory John Casamento 2019-06-10 14:15:41 -04:00
parent 268b2203c7
commit ad5790b9e5
2 changed files with 13 additions and 18 deletions

View file

@ -268,17 +268,6 @@ static Class mutableSetClass;
return self;
}
- (id) initWithObject: (id)obj
{
id objs[] = {obj};
self = [self initWithObjects: objs count: 1];
if(self == nil)
{
NSLog(@"Problem initializing with one element");
}
return self;
}
@end
@implementation GSMutableOrderedSet
@ -313,8 +302,13 @@ static Class mutableSetClass;
- (void) insertObject: (id)object atIndex: (NSUInteger)index
{
GSIArrayItem item;
item.obj = object;
GSIArrayInsertItem(&array, item, index);
if([self containsObject: object] == NO)
{
item.obj = object;
GSIArrayInsertItem(&array, item, index);
RETAIN(object);
_version++;
}
}
- (void) removeObjectAtIndex: (NSUInteger)index

View file

@ -471,13 +471,14 @@ static SEL rlSel;
return self;
}
- (instancetype) initWithObject:(id)object
- (instancetype) initWithObject: (id)obj
{
self = [super init];
if(self != nil)
id objs[] = {obj};
self = [self initWithObjects: objs count: 1];
if(self == nil)
{
// Need proper implementation to happen in subclass since it will define how data
// is stored.
NSLog(@"Problem initializing with one element");
}
return self;
}