void (int fileId, int nameId) { int single = singularMapping.get(nameId); int[] multi = multiMapping.get(nameId); if (single == fileId) { singularMapping.remove(nameId); } else if (multi != null) { if (multi.length == 2) { if (multi[0] == fileId) { multiMapping.remove(nameId); singularMapping.put(nameId, multi[1]); } else if (multi[1] == fileId) { multiMapping.remove(nameId); singularMapping.put(nameId, multi[0]); } } else { boolean found = false; for (int i = 1, len = multi[0]; i <= len; i++) { if (found) { multi[i - 1] = multi[i]; } else if (multi[i] == fileId) { found = true; multi[0]--; } } if (found) { int len = multi[0]; if (len == 0) { multiMapping.remove(nameId); } else if (len == 1) { multiMapping.remove(nameId); singularMapping.put(nameId, multi[1]); } else if (len == 2) { multiMapping.put(nameId, new int[]{multi[1], multi[2]}); } else { multi[len + 1] = NULL_NAME_ID; } } } } if (CHECK_CONSISTENCY) { checkConsistency(nameId); } }