Fix binary search in CPArray to allow searching for 0.

This commit is contained in:
Ross Boucher committed 2008-10-26 23:06:23 -07:00
1 parent 8fcf7581e6
commit 80f95e4d58
2 files changed
+2 -451

No files matched your search

+2 -2
View File
@@ -461,9 +461,9 @@
*/
- (unsigned)indexOfObject:(id)anObject sortedByFunction:(Function)aFunction context:(id)aContext
{
if (!aFunction || !anObject)
if (!aFunction || anObject === undefined)
return CPNotFound;
var mid, c, first = 0, last = length - 1;
while (first <= last)
{