mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-20 07:15:01 +00:00
Fix binary search in CPArray to allow searching for 0.
This commit is contained in:
1 parent
8fcf7581e6
commit
80f95e4d58
2 files changed
+2
-451
No files matched your search
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user