Minor: drop unnecessary wrapper for utility function
^KT-39734
This commit is contained in:
+2
-2
@@ -7,7 +7,7 @@ package org.jetbrains.kotlin.idea.caches.project
|
||||
|
||||
import com.intellij.openapi.util.ModificationTracker
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.ResolutionAnchorCacheService
|
||||
import org.jetbrains.kotlin.idea.caches.trackers.ResolutionAnchorModificationCountService
|
||||
import org.jetbrains.kotlin.idea.caches.trackers.getLatestModificationCount
|
||||
|
||||
class ResolutionAnchorAwareLibraryModificationTracker(
|
||||
private val libraryInfo: LibraryInfo,
|
||||
@@ -16,6 +16,6 @@ class ResolutionAnchorAwareLibraryModificationTracker(
|
||||
val anchorDependencyModules = ResolutionAnchorCacheService.getInstance(libraryInfo.project)
|
||||
.getDependencyResolutionAnchors(libraryInfo)
|
||||
.map { it.module }
|
||||
return ResolutionAnchorModificationCountService.getLatestModificationCount(anchorDependencyModules)
|
||||
return getLatestModificationCount(anchorDependencyModules)
|
||||
}
|
||||
}
|
||||
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.caches.trackers
|
||||
|
||||
import com.intellij.openapi.module.Module
|
||||
import com.intellij.openapi.util.ModificationTracker
|
||||
|
||||
object ResolutionAnchorModificationCountService {
|
||||
fun getLatestModificationCount(anchorModules: Collection<Module>): Long {
|
||||
if (anchorModules.isEmpty())
|
||||
return ModificationTracker.NEVER_CHANGED.modificationCount
|
||||
|
||||
val modificationCountUpdater =
|
||||
KotlinCodeBlockModificationListener.getInstance(anchorModules.first().project).perModuleOutOfCodeBlockTrackerUpdater
|
||||
return anchorModules.maxOfOrNull { modificationCountUpdater.getModificationCount(it) }
|
||||
?: ModificationTracker.NEVER_CHANGED.modificationCount
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.caches.trackers
|
||||
|
||||
import com.intellij.openapi.module.Module
|
||||
import com.intellij.openapi.util.ModificationTracker
|
||||
|
||||
fun getLatestModificationCount(modules: Collection<Module>): Long {
|
||||
if (modules.isEmpty())
|
||||
return ModificationTracker.NEVER_CHANGED.modificationCount
|
||||
|
||||
val modificationCountUpdater =
|
||||
KotlinCodeBlockModificationListener.getInstance(modules.first().project).perModuleOutOfCodeBlockTrackerUpdater
|
||||
return modules.maxOfOrNull { modificationCountUpdater.getModificationCount(it) }
|
||||
?: ModificationTracker.NEVER_CHANGED.modificationCount
|
||||
}
|
||||
Reference in New Issue
Block a user