Cache a few more classes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3545 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-01-08 09:47:45 +00:00
parent 9089e9c641
commit 433e3fed93
2 changed files with 32 additions and 23 deletions

View file

@ -71,10 +71,12 @@
* class with an underscore prepended.
*/
typedef struct {
/*
* String classes
*/
Class _NSArray;
Class _NSMutableArray;
Class _NSDictionary;
Class _NSMutableDictionary;
Class _NSString;
Class _NSMutableString;
Class _NSGString;
Class _NSGMutableString;
Class _NSGCString;
@ -161,7 +163,8 @@ fastSuper(Class cls)
static INLINE BOOL
fastClassIsKindOfClass(Class c0, Class c1)
{
while (c0 != Nil) {
while (c0 != Nil)
{
if (c0 == c1)
return YES;
c0 = class_get_super_class(c0);
@ -214,4 +217,5 @@ fastSelectorTypes(SEL s)
*/
extern NSZone *fastZone(NSObject* obj);
#endif

View file

@ -58,7 +58,12 @@ void _fastBuildCache()
* Cache some classes for quick access later.
*/
_fastCls._NSArray = [NSArray class];
_fastCls._NSMutableArray = [NSMutableArray class];
_fastCls._NSDictionary = [NSDictionary class];
_fastCls._NSMutableDictionary = [NSMutableDictionary class];
_fastCls._NSString = [NSString class];
_fastCls._NSMutableString = [NSMutableString class];
_fastCls._NSGString = [NSGString class];
_fastCls._NSGMutableString = [NSGMutableString class];
_fastCls._NSGCString = [NSGCString class];