if (DEBUG) { if (cmids[index] != cmid) { VM.sysWrite("cmids["); VM.sysWrite(index, false); VM.sysWrite("] != "); VM.sysWrite(cmid, false); VM.sysWrite("\n");  VM.sysWrite("cmids["); VM.sysWrite(index, false); VM.sysWrite("] = "); VM.sysWrite(cmids[index], false); VM.sysWrite("\n"); }  if (map[cmid] != index) { VM.sysWrite("map["); VM.sysWrite(cmid, false); VM.sysWrite("] != "); VM.sysWrite(index, false); VM.sysWrite("\n");  VM.sysWrite("map["); VM.sysWrite(cmid, false); VM.sysWrite("] = "); VM.sysWrite(map[cmid], false); VM.sysWrite("\n"); } }
  private int findOrCreateHeapIdx(int cmid) {    if (cmid >= map.length) {      growHeapMap(cmid);    }    int index = map[cmid];    if (index == 0) {      // A new cmid. Allocate a heap entry for it.      index = nextIndex++;      if (index >= counts.length) {	growHeap();      }      counts[index] = 0.0;      cmids[index] = cmid;      map[cmid] = index;    }    if (DEBUG) {      if (cmids[index] != cmid) {	VM.sysWrite("cmids[");	VM.sysWrite(index, false);	VM.sysWrite("] != ");	VM.sysWrite(cmid, false);	VM.sysWrite("\n");		VM.sysWrite("cmids[");	VM.sysWrite(index, false);	VM.sysWrite("] = ");	VM.sysWrite(cmids[index], false);	VM.sysWrite("\n");      }            if (map[cmid] != index) {	VM.sysWrite("map[");	VM.sysWrite(cmid, false);	VM.sysWrite("] != ");	VM.sysWrite(index, false);	VM.sysWrite("\n");		VM.sysWrite("map[");	VM.sysWrite(cmid, false);	VM.sysWrite("] = ");	VM.sysWrite(map[cmid], false);	VM.sysWrite("\n");      }    }    return index;  }