SortedList.prototype.keys = function()

in src/lib/sortedList.js [144:160]


SortedList.prototype.keys = function(val, bsResult) {
  var ret = [];
  if (bsResult == null) bsResult = this.bsearch(val);
  var pos = bsResult;
  while (pos >= 0 && this._compare(this[pos], val) == 0) {
    ret.push(pos);
    pos--;
  }

  var len = this.length;
  pos = bsResult+1;
  while (pos < len && this._compare(this[pos], val) == 0) {
    ret.push(pos);
    pos++;
  }
  return ret.length ? ret : null;
};