Skip to content

Commit

Permalink
Loop on list in ScalacOption.sanitize
Browse files Browse the repository at this point in the history
  • Loading branch information
adpi2 committed Aug 24, 2023
1 parent b0b642f commit c1b65f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions migrate/src/main/scala/migrate/internal/ScalacOption.scala
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,15 @@ object ScalacOption {
val tokens = CommandLineParser.tokenize(line) // could throw an exception

@tailrec
def loop(args: Seq[String], res: Seq[String]): Seq[String] =
def loop(args: List[String], res: List[String]): List[String] =
args match {
case Nil => res
case first :: second :: tail if first.startsWith("-") && !second.startsWith("-") =>
loop(tail, res :+ (s"$first $second"))

case first :: tail => loop(tail, res :+ first)
case first :: tail => loop(tail, first :: res)
}
loop(tokens, Nil)
loop(tokens, Nil).reverse
}

sealed abstract class Renamed(val scala2Value: String, val scala3Value: String)
Expand Down

0 comments on commit c1b65f3

Please sign in to comment.