Code simplification

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@8275 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-12-07 23:07:37 +00:00
parent edc67ffd44
commit 24451e5cbc
6 changed files with 20 additions and 59 deletions

View file

@ -3,8 +3,9 @@
* Source/NSGSet.m: renamed to GSSet.m for consistency, tidied.
* Source/NSGCountedSet.m: renamed to GSCountedSet.m for consistency.
* Headers/Foundation/NSGSet.h: removed - obsolete.
* Headers/Foundation/NSSet.h: si9mplified back to single class
* Source/NSSet.m: Updated and tidied. Fixed coding class for
mutable sets.
mutable sets. Removed non-core classes.
2000-12-05 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -36,34 +36,29 @@
+ (id) setWithObjects: (id)anObject, ...;
+ (id) setWithSet: (NSSet*)aSet;
- (id) initWithObjects: (id*)objects
count: (unsigned)count;
- (unsigned) count;
- (id) member: (id)anObject;
- (NSEnumerator*) objectEnumerator;
@end
@interface NSSet (NonCore)
- (id) initWithArray: (NSArray*)array;
- (id) initWithObjects: (id)objects, ...;
- (id) initWithObjects: firstObject rest: (va_list)ap;
- (id) initWithSet: (NSSet*)otherSet;
- (id) initWithSet: (NSSet*)otherSet copyItems: (BOOL)flags;
- (NSArray*) allObjects;
- (id) anyObject;
- (BOOL) containsObject: (id)anObject;
- (void) makeObjectsPerform: (SEL)aSelector;
- (void) makeObjectsPerform: (SEL)aSelector withObject: (id)argument;
- (unsigned) count;
- (NSString*) descriptionWithLocale: (NSDictionary*)ld;
- (id) initWithArray: (NSArray*)array;
- (id) initWithObjects: (id)objects, ...;
- (id) initWithObjects: (id*)objects
count: (unsigned)count;
- (id) initWithObjects: firstObject
rest: (va_list)ap;
- (id) initWithSet: (NSSet*)otherSet;
- (id) initWithSet: (NSSet*)otherSet copyItems: (BOOL)flags;
- (BOOL) intersectsSet: (NSSet*)other;
- (BOOL) isEqualToSet: (NSSet*)other;
- (BOOL) isSubsetOfSet: (NSSet*)other;
- (NSString*) descriptionWithLocale: (NSDictionary*)ld;
- (void) makeObjectsPerform: (SEL)aSelector;
- (void) makeObjectsPerform: (SEL)aSelector withObject: (id)argument;
- (id) member: (id)anObject;
- (NSEnumerator*) objectEnumerator;
@end
@ -71,19 +66,14 @@
+ (id) setWithCapacity: (unsigned)numItems;
- (id) initWithCapacity: (unsigned)numItems;
- (void) addObject: (id)anObject;
- (void) removeObject: (id)anObject;
@end
@interface NSMutableSet (NonCore)
- (void) addObjectsFromArray: (NSArray*)array;
- (void) unionSet: (NSSet*)other;
- (id) initWithCapacity: (unsigned)numItems;
- (void) intersectSet: (NSSet*)other;
- (void) minusSet: (NSSet*)other;
- (void) removeAllObjects;
- (void) removeObject: (id)anObject;
- (void) unionSet: (NSSet*)other;
@end
@ -112,7 +102,7 @@
* GSUnique() returns an object that is equal to the one passed to it.
* If the returned object is not the same object as the object passed in,
* the original object is released and the returned object is retained.
* Thus, an -init metod that wants to implement uniquing simply needs
* Thus, an -init method that wants to implement uniquing simply needs
* to end with 'return GSUnique(self);'
*/
void GSUniquing(BOOL flag);

View file

@ -39,9 +39,6 @@
#include <base/GSIMap.h>
@class NSSetNonCore;
@class NSMutableSetNonCore;
@interface GSCountedSet : NSCountedSet
{
@public
@ -96,8 +93,6 @@
{
if (self == [GSCountedSet class])
{
class_add_behavior(self, [NSSetNonCore class]);
class_add_behavior(self, [NSMutableSetNonCore class]);
}
}

View file

@ -39,9 +39,6 @@
#include <base/GSIMap.h>
@class NSSetNonCore;
@class NSMutableSetNonCore;
@interface GSSet : NSSet
{
@public
@ -107,7 +104,6 @@ static Class mutableSetClass;
{
if (self == [GSSet class])
{
class_add_behavior(self, [NSSetNonCore class]);
arrayClass = [NSArray class];
setClass = [GSSet class];
mutableSetClass = [GSMutableSet class];
@ -424,7 +420,6 @@ static Class mutableSetClass;
{
if (self == [GSMutableSet class])
{
class_add_behavior(self, [NSMutableSetNonCore class]);
class_add_behavior(self, [GSSet class]);
}
}

View file

@ -33,8 +33,6 @@
#include <Foundation/NSThread.h>
#include <Foundation/NSObjCRuntime.h>
@class NSSetNonCore;
@class NSMutableSetNonCore;
@class GSCountedSet;
/*
@ -62,8 +60,6 @@ static Class NSCountedSet_concrete_class;
{
NSCountedSet_abstract_class = self;
NSCountedSet_concrete_class = [GSCountedSet class];
behavior_class_add_class(self, [NSMutableSetNonCore class]);
behavior_class_add_class(self, [NSSetNonCore class]);
if ([NSThread isMultiThreaded])
{
[self _becomeThreaded: nil];

View file

@ -34,11 +34,6 @@
@class GSSet;
@class GSMutableSet;
@interface NSSetNonCore : NSSet
@end
@interface NSMutableSetNonCore: NSMutableSet
@end
@implementation NSSet
static Class NSSet_abstract_class;
@ -66,7 +61,6 @@ static Class NSMutableSet_concrete_class;
NSMutableSet_abstract_class = [NSMutableSet class];
NSSet_concrete_class = [GSSet class];
NSMutableSet_concrete_class = [GSMutableSet class];
behavior_class_add_class(self, [NSSetNonCore class]);
}
}
@ -195,10 +189,6 @@ static Class NSMutableSet_concrete_class;
return [self subclassResponsibility: _cmd];
}
@end
@implementation NSSetNonCore
/* Same as NSArray */
- (id) initWithObjects: firstObject rest: (va_list)ap
{
@ -462,8 +452,6 @@ static Class NSMutableSet_concrete_class;
{
if (self == [NSMutableSet class])
{
behavior_class_add_class(self, [NSMutableSetNonCore class]);
behavior_class_add_class(self, [NSSetNonCore class]);
}
}
@ -511,10 +499,6 @@ static Class NSMutableSet_concrete_class;
[self subclassResponsibility: _cmd];
}
@end
@implementation NSMutableSetNonCore
- (id) initWithObjects: (id*)objects
count: (unsigned)count
{