docs: private void updateHeap(final double distance, final int iid) {
      final double prevdist = kdist;
      final int previd = heap.peekValue();
      heap.replaceTopElement(distance, iid);
      kdist = heap.peekKey();
      // If the kdist improved, zap ties.
      if(kdist < prevdist) {
        numties = 0;
      }
      else {
        addToTies(previd);
      }
    }