mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-29 18:02:03 +00:00
Further performance improvements.
Reviewed by me.
This commit is contained in:
1 parent
64fd9f615c
commit
81110ddba7
2 files changed
+9
-6
No files matched your search
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user