From 03ea6adac638039f3f019fed07d46d64a966dcdd Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Thu, 20 Sep 2018 19:47:18 +0300 Subject: [PATCH] vcs: cleanup - extract variable --- .../vcs/changes/actions/ChangeListRemoveConfirmation.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ChangeListRemoveConfirmation.kt b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ChangeListRemoveConfirmation.kt index ff271c351ca8..baf618333918 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ChangeListRemoveConfirmation.kt +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ChangeListRemoveConfirmation.kt @@ -28,13 +28,15 @@ abstract class ChangeListRemoveConfirmation() { companion object { @JvmStatic fun processLists(project: Project, explicitly: Boolean, allLists: Collection, ask: ChangeListRemoveConfirmation) { + val manager = ChangeListManager.getInstance(project) + val activeVcss = ProjectLevelVcsManager.getInstance(project).allActiveVcss + val allIds = allLists.map { it.id } val confirmationAsked = hashSetOf() val doNotRemove = hashSetOf() - val manager = ChangeListManager.getInstance(project) for (id in allIds) { - for (vcs in ProjectLevelVcsManager.getInstance(project).allActiveVcss) { + for (vcs in activeVcss) { val list = manager.getChangeList(id) val permission = if (list == null) ThreeState.NO else vcs.mayRemoveChangeList(list, explicitly) if (permission != ThreeState.UNSURE) {