Skip to content

Commit 196b3fa

Browse files
committed
Style tweaks
1 parent 973b285 commit 196b3fa

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

compiler/src/dotty/tools/dotc/config/Settings.scala

+12-12
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ object Settings {
2222
val OutputTag: ClassTag[AbstractFile] = ClassTag(classOf[AbstractFile])
2323

2424
class SettingsState(initialValues: Seq[Any]) {
25-
private var values = ArrayBuffer(initialValues: _*)
25+
private val values = ArrayBuffer(initialValues: _*)
2626
private var _wasRead: Boolean = false
2727

2828
override def toString: String = s"SettingsState(values: ${values.toList})"
@@ -89,26 +89,26 @@ object Settings {
8989
def isDefaultIn(state: SettingsState): Boolean = valueIn(state) == default
9090

9191
def legalChoices: String =
92-
if (choices.isEmpty) ""
93-
else choices match {
94-
case r: Range => s"${r.head}..${r.last}"
95-
case xs: List[?] => xs.mkString(", ")
92+
choices match {
93+
case xs if xs.isEmpty => ""
94+
case r: Range => s"${r.head}..${r.last}"
95+
case xs: List[?] => xs.toString
9696
}
9797

9898
def isLegal(arg: Any): Boolean =
99-
if (choices.isEmpty)
100-
arg match {
101-
case _: T => true
102-
case _ => false
103-
}
104-
else choices match {
99+
choices match {
100+
case xs if xs.isEmpty =>
101+
arg match {
102+
case _: T => true
103+
case _ => false
104+
}
105105
case r: Range =>
106106
arg match {
107107
case x: Int => r.head <= x && x <= r.last
108108
case _ => false
109109
}
110110
case xs: List[?] =>
111-
xs contains arg
111+
xs.contains(arg)
112112
}
113113

114114
def tryToSet(state: ArgsSummary): ArgsSummary = {

0 commit comments

Comments
 (0)