Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added some comments

  • Loading branch information...
commit 7d1cc4aba157b8ee5b0a8f00dbf4dd5fbfbaf0b3 1 parent f368197
@kriszyp kriszyp authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  Observable.js
View
2  Observable.js
@@ -221,6 +221,7 @@ define([
sortedIndex,
adjustedIndex;
while (begin <= end && insertedInto === -1) {
+ // doing a binary search for the containing range
i = begin + Math.round((end - begin) / 2);
range = ranges[i];
@@ -276,6 +277,7 @@ define([
event.index = insertedInto;
resultsArray.splice(insertedInto, 0, target);
+ // update the count and start of the appropriate ranges
ranges[insertionRangeIndex].count++;
for (i = insertionRangeIndex + 1; i < ranges.length; ++i) {
ranges[i].start++;
Please sign in to comment.
Something went wrong with that request. Please try again.