simplify.js
function heapUpdate(i, w) {
    var a = heap[i]
    if(weights[a] === w) {
      return i
    }
    weights[a] = -Infinity
    heapUp(i)
    heapPop()
    weights[a] = w
    heapCount += 1
    return heapUp(heapCount-1)
  }
function heapUpdate(i, w) {
    var a = heap[i]
    if(weights[a] === w) {
      return i
    }
    weights[a] = -Infinity
    heapUp(i)
    heapPop()
    weights[a] = w
    heapCount += 1
    return heapUp(heapCount-1)
  }
function heapUpdate ( i , w ) { var a = heap [ i ] if ( weights [ a ] === w ) { return i } weights [ a ] = - Infinity heapUp ( i ) heapPop ( ) weights [ a ] = w heapCount += 1 return heapUp ( heapCount - 1 ) }
Update heap item i
Update heap item i