[vcs-log] inline VcsLogStorageBackend#getRename function

GitOrigin-RevId: 5ec95ad28757b495a529da80e98f96e7cb14eb0f
This commit is contained in:
Julia Beliaeva
2023-07-20 00:37:43 +00:00
committed by intellij-monorepo-bot
parent 08d8bab3be
commit f428648590
3 changed files with 5 additions and 13 deletions
@@ -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<FilePath?>? {
val renames = getRename(parent, child)
val renames = renames.get(intArrayOf(parent, child))
if (renames == null || renames.isEmpty()) {
return null
}
@@ -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<String>,
@@ -461,7 +454,10 @@ internal class SqliteVcsLogStorageBackend(project: Project,
}
override fun findRename(parent: Int, child: Int, root: VirtualFile, path: FilePath, isChildPath: Boolean): EdgeData<FilePath?>? {
val renames = getRename(parent, child)
val renames = connectionManager.selectRename.use { statement, binder ->
binder.bind(parent, child)
readIntArray(statement)
}
if (renames.isEmpty()) {
return null
}
@@ -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,