[vcs-log] cleanup: simplify if statement

GitOrigin-RevId: 358b92198278a240d4f2142f058fe51eb0d8ebf7
This commit is contained in:
Julia Beliaeva
2024-03-23 21:30:58 +00:00
committed by intellij-monorepo-bot
parent 3fe4ae7160
commit 6ad9967cdc
@@ -1,4 +1,4 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.vcs.log.impl
import com.google.common.util.concurrent.Futures
@@ -63,13 +63,11 @@ object VcsLogNavigationUtil {
private suspend fun jumpToRevision(project: Project, root: VirtualFile, hash: Hash, filePath: FilePath): Boolean {
val logUi = showCommitInLogTab(project, hash, root, false) { logUi ->
if (logUi.properties.exists(MainVcsLogUiProperties.SHOW_ONLY_AFFECTED_CHANGES) &&
logUi.properties[MainVcsLogUiProperties.SHOW_ONLY_AFFECTED_CHANGES] &&
!logUi.properties.getFilterValues(VcsLogFilterCollection.STRUCTURE_FILTER.name).isNullOrEmpty()) {
// Structure filter might prevent us from navigating to FilePath
return@showCommitInLogTab false
}
return@showCommitInLogTab true
// Structure filter might prevent us from navigating to FilePath
val hasFilteredChanges = logUi.properties.exists(MainVcsLogUiProperties.SHOW_ONLY_AFFECTED_CHANGES) &&
logUi.properties[MainVcsLogUiProperties.SHOW_ONLY_AFFECTED_CHANGES] &&
!logUi.properties.getFilterValues(VcsLogFilterCollection.STRUCTURE_FILTER.name).isNullOrEmpty()
return@showCommitInLogTab !hasFilteredChanges
} ?: return false
logUi.selectFilePath(filePath, true)