public final synchronized void reset(int cmid) { int index = findHeapIdx(cmid); if (index > 0) {        map[cmid] = 0; nextIndex--; if (index < nextIndex) { double oldValue = counts[index]; counts[index] = counts[nextIndex]; cmids[index] = cmids[nextIndex]; map[cmids[index]] = index; if (counts[index] > oldValue) { heapifyUp(index); } else { heapifyDown(index); } } } if (DEBUG) validityCheck();
public final synchronized void reset() { initialize();
  public final synchronized void reset(int cmid) {    int index = findHeapIdx(cmid);    if (index > 0) {      // Cmid does have a value in the heap.       // (1) clear map[cmid].      // (2) shrink the heap by one slot.        //     (a) If index is the last element in the heap we have nothing       //         to do after we decrement nextIndex.      //     (b) If index is not the last element in the heap, then move the      //         last heap element to index and heapify.      map[cmid] = 0;      nextIndex--;      if (index < nextIndex) {	double oldValue = counts[index];	counts[index] = counts[nextIndex];	cmids[index] = cmids[nextIndex];	map[cmids[index]] = index;	if (counts[index] > oldValue) {	  heapifyUp(index);	} else {	  heapifyDown(index);	}      }     }    if (DEBUG) validityCheck();  }