From 4a8ca8e1fddd303d6e281712b229ab14d46a8002 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Tue, 24 Apr 2018 10:38:47 +0200 Subject: [PATCH] =?UTF-8?q?cleanup=20=E2=80=94=20remove=20unused=20updateC?= =?UTF-8?q?urrentScheme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/SchemeManagerImpl.kt | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/platform/configuration-store-impl/src/SchemeManagerImpl.kt b/platform/configuration-store-impl/src/SchemeManagerImpl.kt index 96309dbf6d25..534a31b2939f 100644 --- a/platform/configuration-store-impl/src/SchemeManagerImpl.kt +++ b/platform/configuration-store-impl/src/SchemeManagerImpl.kt @@ -213,25 +213,6 @@ class SchemeManagerImpl(val fileSpec: String, } } - internal fun updateCurrentScheme(oldScheme: T?, newScheme: T? = null) { - if (activeScheme != null) { - return - } - - if (oldScheme != activeScheme) { - val scheme = newScheme ?: schemes.firstOrNull() - currentPendingSchemeName = null - activeScheme = scheme - // must be equals by reference - if (oldScheme !== scheme) { - processor.onCurrentSchemeSwitched(oldScheme, scheme) - } - } - else if (newScheme != null) { - processPendingCurrentSchemeName(newScheme) - } - } - override fun reload() { processor.beforeReloaded(this) // we must not remove non-persistent (e.g. predefined) schemes, because we cannot load it (obviously) @@ -281,7 +262,7 @@ class SchemeManagerImpl(val fileSpec: String, return true } - schemes.firstOrNull({ processor.getSchemeKey(it) == schemeName})?.let { existingScheme -> + schemes.firstOrNull { processor.getSchemeKey(it) == schemeName}?.let { existingScheme -> if (schemeListManager.readOnlyExternalizableSchemes.get(processor.getSchemeKey(existingScheme)) === existingScheme) { // so, bundled scheme is shadowed schemeListManager.removeFirstScheme(schemes, scheduleDelete = false) { it === existingScheme }