Avoid compiler warning

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7191 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-08-09 14:40:14 +00:00
parent f048297123
commit ee3d710d31

View file

@ -2159,6 +2159,9 @@ static Class doubleNumberClass;
- (NSComparisonResult) compare: (NSNumber*)other
{
double otherValue;
double myValue;
if (other == self)
{
return NSOrderedSame;
@ -2168,26 +2171,21 @@ static Class doubleNumberClass;
[NSException raise: NSInvalidArgumentException
format: @"nil argument for compare:"];
}
myValue = [self doubleValue];
otherValue = [other doubleValue];
if (myValue == otherValue)
{
return NSOrderedSame;
}
else if (myValue < otherValue)
{
return NSOrderedAscending;
}
else
{
double otherValue;
double myValue;
myValue = [self doubleValue];
otherValue = [other doubleValue];
if (myValue == otherValue)
{
return NSOrderedSame;
}
else if (myValue < otherValue)
{
return NSOrderedAscending;
}
else
{
return NSOrderedDescending;
}
return NSOrderedDescending;
}
}