Fixes two bugs in compareObjectsUsingDescriptors causing test to fail: extra semi-colon after while() and uninitized "result" variable.

The former masked the latter when a single sort descriptor was used.
This commit is contained in:
Tom Robinson
2010-08-13 15:34:28 -07:00
parent 4c0057e66a
commit 4eaf560ee6
+3 -3
View File
@@ -1378,12 +1378,12 @@ var selectorCompare = function selectorCompare(object1, object2, selector)
// sort using sort descriptors
var compareObjectsUsingDescriptors= function compareObjectsUsingDescriptors(lhs, rhs, descriptors)
{
var result,
var result = CPOrderedSame,
i = 0,
n = [descriptors count];
while (i < n && result == CPOrderedSame);
result = [descriptors[i++] compareObject:lhs withObject:rhs];
while (i < n && result === CPOrderedSame)
result = [descriptors[i++] compareObject:lhs withObject:rhs];
return result;
}