examples/dist/common.js
function findInsertionPosition(queue, update) {
  var priorityLevel = update.priorityLevel;
  var insertAfter = null;
  var insertBefore = null;
  if (queue.last !== null && comparePriority(queue.last.priorityLevel, priorityLevel) <= 0) {
    // Fast path for the common case where the update should be inserted at
    // the end of the queue.
    insertAfter = queue.last;
  } else {
    insertBefore = queue.first;
    while (insertBefore !== null && comparePriority(insertBefore.priorityLevel, priorityLevel) <= 0) {
      insertAfter = insertBefore;
      insertBefore = insertBefore.next;
    }
  }
  return insertAfter;
}
function findInsertionPosition(queue, update) {
  var priorityLevel = update.priorityLevel;
  var insertAfter = null;
  var insertBefore = null;
  if (queue.last !== null && comparePriority(queue.last.priorityLevel, priorityLevel) <= 0) {
    // Fast path for the common case where the update should be inserted at
    // the end of the queue.
    insertAfter = queue.last;
  } else {
    insertBefore = queue.first;
    while (insertBefore !== null && comparePriority(insertBefore.priorityLevel, priorityLevel) <= 0) {
      insertAfter = insertBefore;
      insertBefore = insertBefore.next;
    }
  }
  return insertAfter;
}
function findInsertionPosition ( queue , update ) { var priorityLevel = update . priorityLevel ; var insertAfter = null ; var insertBefore = null ; if ( queue . last !== null && comparePriority ( queue . last . priorityLevel , priorityLevel ) <= 0 ) { // Fast path for the common case where the update should be inserted at // the end of the queue. insertAfter = queue . last ; } else { insertBefore = queue . first ; while ( insertBefore !== null && comparePriority ( insertBefore . priorityLevel , priorityLevel ) <= 0 ) { insertAfter = insertBefore ; insertBefore = insertBefore . next ; } } return insertAfter ; }
Returns the update after which the incoming update should be inserted into the queue, or null if it should be inserted at beginning.
Returns the update after which the incoming update should be inserted into the queue or null if it should be inserted at beginning .