[2.x] refactor: Remove unnecessary match (#9539)

This commit is contained in:
kenji yoshida 2026-08-02 18:41:01 +09:00 committed by GitHub
parent c407f37739
commit 040eaaa062
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -74,12 +74,12 @@ private[sbt] object CrossJava {
val ds = val ds =
if (!first.contains(".") && first.contains("u")) splitDot(first.replaceFirst("u", ".0.")) if (!first.contains(".") && first.contains("u")) splitDot(first.replaceFirst("u", ".0."))
else splitDot(first) else splitDot(first)
val nums = ds.takeWhile( val nums = ds
_ match { .takeWhile {
case Num(_) => true case Num(_) => true
case _ => false case _ => false
} }
) map { _.toLong } .map { _.toLong }
if (nums.isEmpty) { if (nums.isEmpty) {
sys.error(s"Invalid SDKMAN Java version: $version") sys.error(s"Invalid SDKMAN Java version: $version")
} }

View File

@ -104,7 +104,7 @@ private[sbt] class ServerSessionImpl(
.deserializeJsonMessage(frame) .deserializeJsonMessage(frame)
.fold( .fold(
errorDesc => onInvalidFrame(frame, errorDesc), errorDesc => onInvalidFrame(frame, errorDesc),
_ match { {
case msg: JsonRpcRequestMessage => onRequest(msg) case msg: JsonRpcRequestMessage => onRequest(msg)
case msg: JsonRpcResponseMessage => onResponse(msg) case msg: JsonRpcResponseMessage => onResponse(msg)
case msg: JsonRpcNotificationMessage => onNotification(msg) case msg: JsonRpcNotificationMessage => onNotification(msg)