mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Move methods to abstract class. Implement setValue:...
This commit is contained in:
parent
268b2203c7
commit
ad5790b9e5
2 changed files with 13 additions and 18 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue