documentation added and a couple of tidyups

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24009 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2006-11-01 15:04:57 +00:00
parent b4a0ecdac3
commit ff1421c20a
5 changed files with 67 additions and 16 deletions

View file

@ -43,15 +43,21 @@
- (NSComparisonResult) compareObject: (id) object1 toObject: (id) object2
{
NSComparisonResult result;
id comparedKey1 = [object1 valueForKeyPath: _key],
comparedKey2 = [object2 valueForKeyPath: _key];
id comparedKey1 = [object1 valueForKeyPath: _key];
id comparedKey2 = [object2 valueForKeyPath: _key];
result = (NSComparisonResult) [comparedKey1 performSelector: _selector
withObject: comparedKey2];
if (_ascending != YES)
if (_ascending == NO)
{
result = -result;
if (result == NSOrderedAscending)
{
result = NSOrderedDescending;
}
else if (result == NSOrderedDescending)
{
result = NSOrderedAscending;
}
}
return result;