mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Tiny performance improvements when testing for equality
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6336 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
16ea7d5057
commit
77e32f2c78
2 changed files with 9 additions and 1 deletions
|
@ -273,7 +273,7 @@
|
|||
format: @"Cannot copy value into NULL pointer"];
|
||||
/* NOT REACHED */
|
||||
}
|
||||
memcpy( value, &data, objc_sizeof_type([self objCType]) );
|
||||
memcpy(value, &data, objc_sizeof_type([self objCType]));
|
||||
}
|
||||
|
||||
- (const char*) objCType
|
||||
|
|
|
@ -777,6 +777,10 @@ static Class doubleNumberClass;
|
|||
|
||||
- (BOOL) isEqual: o
|
||||
{
|
||||
if (o == self)
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
if (o != nil && fastIsInstance(o)
|
||||
&& fastInstanceIsKindOfClass(o, abstractClass))
|
||||
{
|
||||
|
@ -787,6 +791,10 @@ static Class doubleNumberClass;
|
|||
|
||||
- (BOOL) isEqualToNumber: (NSNumber*)o
|
||||
{
|
||||
if (o == self)
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
if ([self compare: o] == NSOrderedSame)
|
||||
{
|
||||
return YES;
|
||||
|
|
Loading…
Reference in a new issue