From f428648590b5924d45fd80aff41317f2b900156e Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Thu, 20 Jul 2023 01:46:00 +0200 Subject: [PATCH] [vcs-log] inline VcsLogStorageBackend#getRename function GitOrigin-RevId: 5ec95ad28757b495a529da80e98f96e7cb14eb0f --- .../vcs/log/data/index/PhmVcsLogStorageBackend.kt | 4 +--- .../vcs/log/data/index/SqliteVcsLogStorageBackend.kt | 12 ++++-------- .../vcs/log/data/index/VcsLogStorageBackend.kt | 2 -- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/PhmVcsLogStorageBackend.kt b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/PhmVcsLogStorageBackend.kt index 1d35de9d5fb1..d644636f0729 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/PhmVcsLogStorageBackend.kt +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/PhmVcsLogStorageBackend.kt @@ -258,11 +258,9 @@ internal class PhmVcsLogStorageBackend( return this.users.getCommitsForUsers(users) } - override fun getRename(parent: Int, child: Int): IntArray? = renames.get(intArrayOf(parent, child)) - @Throws(IOException::class) override fun findRename(parent: Int, child: Int, root: VirtualFile, path: FilePath, isChildPath: Boolean): EdgeData? { - val renames = getRename(parent, child) + val renames = renames.get(intArrayOf(parent, child)) if (renames == null || renames.isEmpty()) { return null } diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/SqliteVcsLogStorageBackend.kt b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/SqliteVcsLogStorageBackend.kt index c69a1577dd36..f701137117f7 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/SqliteVcsLogStorageBackend.kt +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/SqliteVcsLogStorageBackend.kt @@ -306,13 +306,6 @@ internal class SqliteVcsLogStorageBackend(project: Project, } } - override fun getRename(parent: Int, child: Int): IntArray { - return connectionManager.selectRename.use { statement, binder -> - binder.bind(parent, child) - readIntArray(statement) - } - } - override fun getCommitsForSubstring(string: String, candidates: IntSet?, noTrigramSources: MutableList, @@ -461,7 +454,10 @@ internal class SqliteVcsLogStorageBackend(project: Project, } override fun findRename(parent: Int, child: Int, root: VirtualFile, path: FilePath, isChildPath: Boolean): EdgeData? { - val renames = getRename(parent, child) + val renames = connectionManager.selectRename.use { statement, binder -> + binder.bind(parent, child) + readIntArray(statement) + } if (renames.isEmpty()) { return null } diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/VcsLogStorageBackend.kt b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/VcsLogStorageBackend.kt index 80ce67bdaa95..ff897baff3c4 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/VcsLogStorageBackend.kt +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/data/index/VcsLogStorageBackend.kt @@ -42,8 +42,6 @@ internal interface VcsLogStorageBackend : VcsLogUsersStorage, VcsLogPathsStorage @Throws(IOException::class) fun processMessages(processor: (Int, String) -> Boolean) - fun getRename(parent: Int, child: Int): IntArray? - fun createWriter(): VcsLogWriter fun getCommitsForSubstring(string: String,