We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 293a05c commit faf219eCopy full SHA for faf219e
core/src/main/scala/TournamentClock.scala
@@ -16,10 +16,10 @@ object TournamentClock:
16
TournamentClock(limit, IncrementSeconds(b))
17
18
def apply(str: String): Option[TournamentClock] =
19
- val clean = cleanRegex.replaceAllIn(str.toLowerCase, "").replace(" ", "")
20
- clean.toIntOption
21
- .map(make(_, 0))
22
- .orElse:
23
- clean.split('+') match
24
- case Array(a, b) => (a.toIntOption, b.toIntOption).mapN(make)
25
- case _ => none
+ cleanRegex
+ .replaceAllIn(str.toLowerCase, "")
+ .replace(" ", "")
+ .split('+') match
+ case Array(a) => a.toIntOption.map(make(_, 0))
+ case Array(a, b) => (a.toIntOption, b.toIntOption).mapN(make)
+ case _ => none
0 commit comments