[vcs-log-graph] correctly detect if commit ids are integers

follow-up: 5692f109943bd905a5542e564e2081782c880704

GitOrigin-RevId: 1578f916beef59b28d3599076f94b5eac6f7f9b3
This commit is contained in:
Julia Beliaeva
2024-03-12 16:31:04 +00:00
committed by intellij-monorepo-bot
parent 634263ad85
commit 099bd2bc84
@@ -73,7 +73,7 @@ class PermanentCommitsInfoImpl<CommitId : Any> private constructor(val timestamp
@JvmStatic
fun <CommitId : Any> newInstance(graphCommits: List<GraphCommit<CommitId>>,
notLoadedCommits: Int2ObjectMap<CommitId>): PermanentCommitsInfoImpl<CommitId> {
val isIntegerCase = !graphCommits.isEmpty() && graphCommits[0].id.javaClass == Int::class.java
val isIntegerCase = !graphCommits.isEmpty() && graphCommits[0].id is Int
val commitIdIndex = if (isIntegerCase) createCompressedIntList(graphCommits as List<GraphCommit<Int>>) as List<CommitId>
else graphCommits.map { it.id }