Further performance improvements.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I committed 2010-02-16 02:41:15 -08:00
1 parent 64fd9f615c
commit 81110ddba7
2 files changed
+9 -6

No files matched your search

+4 -3
View File
@@ -1221,12 +1221,13 @@
if (index >= count)
return 0;
var last = MAX(index + aCount, count);
var indexIndex = 0,
last = MIN(index + aCount, count);
aCount = last - index;
for (; index < last; ++index)
objects[index] = [self objectAtIndex:index];
for (; index < last; ++index, ++indexIndex)
objects[indexIndex] = [self objectAtIndex:index];
aState.state = last;
+5 -3
View File
@@ -846,11 +846,13 @@ var CPIndexSetCountKey = @"CPIndexSetCountKey",
var range = _ranges[rangeIndex],
index = 0,
start = range.location,
end = CPMaxRange(range);
end = start + range.length,
indexes = new Array(range.length);
for (; start < end; ++start, ++index)
objects[index] = start;
while (start < end)
indexes[index++] = start++;
aState.items = indexes;
++aState.state;
return range.length;