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 2000-08-09 14:40:14 +00:00
parent 30730bb37e
commit 0f42d88560

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;
}
}