Remove unused arguments in clean and use site

`cleanCachedResolutionCache` and `clean` were doing extra work because
`clean` does only need to clean the cache in the configuration (that is
a class parameter).
This commit is contained in:
jvican 2017-04-27 21:22:33 +02:00
parent c588869f2e
commit b68498d013
No known key found for this signature in database
GPG Key ID: 42DAFA0F112E8050
2 changed files with 6 additions and 12 deletions

View File

@ -159,15 +159,10 @@ final class IvySbt(val configuration: IvyConfiguration) { self =>
*
* @param md - module descriptor of the original Ivy graph.
*/
private[sbt] def cleanCachedResolutionCache(md: ModuleDescriptor, log: Logger): Unit =
withIvy(log) { i =>
val prOpt = Option(i.getSettings.getResolver(ProjectResolver.InterProject)) map {
case pr: ProjectResolver => pr
}
if (configuration.updateOptions.cachedResolution) {
IvySbt.cachedResolutionResolveCache.clean(md, prOpt)
}
}
private[sbt] def cleanCachedResolutionCache(md: ModuleDescriptor, log: Logger): Unit = {
if (!configuration.updateOptions.cachedResolution) ()
else IvySbt.cachedResolutionResolveCache.clean()
}
final class Module(rawModuleSettings: ModuleSettings) {
val moduleSettings: ModuleSettings = IvySbt.substituteCross(rawModuleSettings)

View File

@ -64,9 +64,8 @@ private[sbt] class CachedResolutionResolveCache {
val maxConflictCacheSize: Int = 1024
val maxUpdateReportCacheSize: Int = 1024
def clean(md0: ModuleDescriptor, prOpt: Option[ProjectResolver]): Unit = {
updateReportCache.clear
}
def clean(): Unit = updateReportCache.clear
def directDependencies(md0: ModuleDescriptor): Vector[DependencyDescriptor] =
md0.getDependencies.toVector
// Returns a vector of (module descriptor, changing, dd)