Set<Integer> (@NotNull Collection<? extends CommitId> commitIds, boolean reportNotFound) { Set<Integer> result = new HashSet<>(); Set<CommitId> matchedIds = new HashSet<>(); for (int i = 0; i < myCommitIdIndexes.size(); i++) { CommitId commitId = myCommitIdIndexes.get(i); if (commitIds.contains(commitId)) { result.add(i); matchedIds.add(commitId); } } if (reportNotFound) { Collection<CommitId> unmatchedIds = ContainerUtil.subtract(commitIds, matchedIds); if (!unmatchedIds.isEmpty()) { LOG.warn("Unmatched commit ids " + unmatchedIds); } } for (Int2ObjectMap.Entry<CommitId> entry : myNotLoadCommits.int2ObjectEntrySet()) { CommitId value = entry.getValue(); if (commitIds.contains(value)) { result.add(entry.getIntKey()); } } return result; }