if (map != null) {
try {
Library.RevisionRef removed = map.remove(v);
if (removed != null) {
for (Iterator<RevisionRef> i = repo.revisionRefs.iterator(); i.hasNext();) {
RevisionRef other = i.next();
if (Arrays.equals(other.revision, removed.revision)) {
i.remove();
}
}
repo.revisionRefs.remove(removed);