add @tailrec wherever possible
parent
d25ef1ff63
commit
5bbb970fb5
|
@ -12,6 +12,7 @@ object Levenshtein {
|
|||
val i = j - dd
|
||||
((i - (threshold - 1)) max 0) until (1 + ((i + t) min a.length))
|
||||
}
|
||||
@scala.annotation.tailrec
|
||||
def loop(j: Int, prev: Array[Int], prevr: Range, next: Array[Int]): Int = {
|
||||
if (j > b.length) prev.last
|
||||
else {
|
||||
|
|
|
@ -160,6 +160,7 @@ final private class LobbyTrouper(
|
|||
private def findCompatible(hook: Hook): Option[Hook] =
|
||||
findCompatibleIn(hook, HookRepo findCompatible hook)
|
||||
|
||||
@scala.annotation.tailrec
|
||||
private def findCompatibleIn(hook: Hook, in: Vector[Hook]): Option[Hook] =
|
||||
in match {
|
||||
case Vector() => none
|
||||
|
|
|
@ -11,6 +11,7 @@ case class Retry(move: String) extends Line
|
|||
object Line {
|
||||
|
||||
def minDepth(lines: Lines): Int = {
|
||||
@scala.annotation.tailrec
|
||||
def walk(subs: Vector[(Lines, Int)]): Option[Int] =
|
||||
subs match {
|
||||
case Vector() => none
|
||||
|
|
|
@ -168,6 +168,7 @@ final private class ChapterMaker(
|
|||
s"""$escapedDomain/(\\w{8,12})"""
|
||||
}.r.unanchored
|
||||
|
||||
@scala.annotation.tailrec
|
||||
private def parseGame(str: String): Fu[Option[Game]] =
|
||||
str match {
|
||||
case s if s.length == Game.gameIdSize => gameRepo game s
|
||||
|
|
|
@ -113,6 +113,7 @@ object Sheet {
|
|||
scores.headOption.exists(_.res == ResWin) &&
|
||||
scores.lift(1).exists(_.res == ResWin)
|
||||
|
||||
@scala.annotation.tailrec
|
||||
private def isDrawStreak(scores: List[Score]): Boolean =
|
||||
scores match {
|
||||
case Nil => false
|
||||
|
|
Loading…
Reference in New Issue