diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/LocalChangeListImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/LocalChangeListImpl.java index 2db12c2f8354..3a70e2412fb0 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/LocalChangeListImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/LocalChangeListImpl.java @@ -63,21 +63,17 @@ public class LocalChangeListImpl extends LocalChangeList { } if (myReadChangesCache != null) { - myReadChangesCache = ContainerUtil.newHashSet(origin.myReadChangesCache); + myReadChangesCache = origin.myReadChangesCache; } } @NotNull @Override public Set getChanges() { - createReadChangesCache(); - return myReadChangesCache; - } - - private void createReadChangesCache() { if (myReadChangesCache == null) { myReadChangesCache = Collections.unmodifiableSet(ContainerUtil.newHashSet(myChanges)); } + return myReadChangesCache; } @NotNull @@ -162,7 +158,6 @@ public class LocalChangeListImpl extends LocalChangeList { } Collection startProcessingChanges(final Project project, @Nullable final VcsDirtyScope scope) { - createReadChangesCache(); final Collection result = new ArrayList<>(); myChangesBeforeUpdate = new OpenTHashSet<>(myChanges); for (Change oldBoy : myChangesBeforeUpdate) { @@ -213,7 +208,6 @@ public class LocalChangeListImpl extends LocalChangeList { removedChanges.addAll(removed); changesDetected = changesDetected || (!removedChanges.isEmpty()); - myReadChangesCache = null; return changesDetected; }