remove unnecessary vararg splice

This commit is contained in:
xuwei-k 2025-01-01 15:47:55 +09:00
parent 439e24fb84
commit 3d6286edc2
6 changed files with 7 additions and 13 deletions

View File

@ -64,12 +64,7 @@ object Configurations {
private[sbt] def defaultConfiguration(mavenStyle: Boolean) = private[sbt] def defaultConfiguration(mavenStyle: Boolean) =
if (mavenStyle) Configurations.Compile else Configurations.Default if (mavenStyle) Configurations.Compile else Configurations.Default
private[sbt] def removeDuplicates(configs: Iterable[Configuration]) = private[sbt] def removeDuplicates(configs: Iterable[Configuration]) =
Set( configs.map(config => (config.name, config)).toMap.values.toSet
scala.collection.mutable
.Map(configs.map(config => (config.name, config)).toSeq*)
.values
.toList*
)
/** Returns true if the configuration should be under the influence of scalaVersion. */ /** Returns true if the configuration should be under the influence of scalaVersion. */
@nowarn @nowarn

View File

@ -437,7 +437,7 @@ class MakePom(val log: Logger) {
configurations: Option[Iterable[Configuration]] configurations: Option[Iterable[Configuration]]
): Seq[DependencyDescriptor] = { ): Seq[DependencyDescriptor] = {
val keepConfigurations = IvySbt.getConfigurations(module, configurations) val keepConfigurations = IvySbt.getConfigurations(module, configurations)
val keepSet: Set[String] = Set(keepConfigurations.toSeq*) val keepSet: Set[String] = keepConfigurations.toSet
def translate(dependency: DependencyDescriptor) = { def translate(dependency: DependencyDescriptor) = {
val keep = dependency.getModuleConfigurations val keep = dependency.getModuleConfigurations
.filter((conf: String) => keepSet.contains(conf)) .filter((conf: String) => keepSet.contains(conf))

View File

@ -625,7 +625,7 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine {
loopLists.toList loopLists.toList
} }
val allModules2: mutable.Map[(String, String), Vector[OrganizationArtifactReport]] = val allModules2: mutable.Map[(String, String), Vector[OrganizationArtifactReport]] =
mutable.Map(allModules0.toSeq*) allModules0.to(mutable.Map)
@tailrec def breakLoops(loops: List[List[(String, String)]]): Unit = @tailrec def breakLoops(loops: List[List[(String, String)]]): Unit =
loops match { loops match {
case Nil => () case Nil => ()

View File

@ -205,9 +205,8 @@ class ClassStamper(
// .get(prodClassName) // .get(prodClassName)
// .map: analyzed => // .map: analyzed =>
// 0L // analyzed.??? we need a hash here // 0L // analyzed.??? we need a hash here
val xs = SortedSet( val xs =
(internalDeps union internalJarDeps union externalDeps union classDigests).toSeq* (internalDeps union internalJarDeps union externalDeps union classDigests).to(SortedSet)
)
if xs.nonEmpty then stamps(className) = xs if xs.nonEmpty then stamps(className) = xs
else () else ()
xs xs

View File

@ -47,7 +47,7 @@ object ProjectQuery:
.examples("@scalaBinaryVersion=3") .examples("@scalaBinaryVersion=3")
.?) .?)
.map { case (proj, params) => .map { case (proj, params) =>
ProjectQuery(proj, Map(params.toSeq*)) ProjectQuery(proj, params.toMap)
} }
.filter( .filter(
(q) => q.projectName.contains("...") || q.params.nonEmpty, (q) => q.projectName.contains("...") || q.params.nonEmpty,

View File

@ -65,7 +65,7 @@ final class Fork(val commandName: String, val runnerClass: Option[String]) {
if (Fork.shouldUseArgumentsFile(options)) if (Fork.shouldUseArgumentsFile(options))
new JProcessBuilder(executable, Fork.createArgumentsFile(options)) new JProcessBuilder(executable, Fork.createArgumentsFile(options))
else else
new JProcessBuilder(command.toArray*) new JProcessBuilder(command*)
workingDirectory.foreach(jpb.directory(_)) workingDirectory.foreach(jpb.directory(_))
environment.foreach { case (k, v) => jpb.environment.put(k, v) } environment.foreach { case (k, v) => jpb.environment.put(k, v) }
if (connectInput) { if (connectInput) {