[settings-sync] IJ-CR-19463: Simplify, use find{} vs forEach{}

GitOrigin-RevId: c98c208698fcf6068ea97278221deb3d3c1b63f9
This commit is contained in:
Rustam Vishnyakov
2022-01-13 18:18:58 +03:00
committed by intellij-monorepo-bot
parent 9c020e15ff
commit 481c06e8e0

View File

@@ -112,14 +112,14 @@ internal class SettingsSyncIdeUpdater(application: Application,
private fun updateSyncSettings(snapshot: SettingsSnapshot) {
val settingsPath = "$OPTIONS_DIRECTORY/" + SettingsSyncSettings.FILE_SPEC
snapshot.fileStates.forEach {
if (it.file == settingsPath) {
snapshot.fileStates.find { it.file == settingsPath }
?.let {
rootConfig.resolve(it.file).write(it.content, 0, it.size)
invokeAndWaitIfNeeded {
componentStore.reloadState(SettingsSyncSettings.getInstance().javaClass)
}
}
}
}
}