replacing maxBy with maxByOption and then resolving maxBy the long way with appropriate fallback value

This commit is contained in:
Fate-JH 2024-05-13 13:20:25 -04:00
parent 02c238181e
commit e5d5fda554

View file

@ -242,7 +242,7 @@ object Support {
individualThreatEstimates.filter(_._1 < 10)
} else {
individualThreatEstimates.filter(_._1 > 10)
}).maxBy(_._2)._1,
}).maxByOption(_._2).map(_._1).getOrElse(0),
defaultValue
)
}