From 4eaf560ee62fe83ee73907aca7e231ed7cabfad3 Mon Sep 17 00:00:00 2001 From: Tom Robinson Date: Fri, 13 Aug 2010 15:34:28 -0700 Subject: [PATCH] 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. --- Foundation/CPArray.j | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Foundation/CPArray.j b/Foundation/CPArray.j index 14931c0bc..6ee14b6af 100755 --- a/Foundation/CPArray.j +++ b/Foundation/CPArray.j @@ -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; }