From e67e48208386aa8d31b4a379a36a7550963bc1d0 Mon Sep 17 00:00:00 2001 From: Hai Zhang Date: Sat, 6 Jan 2024 14:33:54 +0800 Subject: [PATCH] [Refactor] Change Enum.values() to Enum.entries. --- .../me/zhanghai/android/files/provider/ftp/client/Protocol.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/me/zhanghai/android/files/provider/ftp/client/Protocol.kt b/app/src/main/java/me/zhanghai/android/files/provider/ftp/client/Protocol.kt index b4026b380..48942a0a2 100644 --- a/app/src/main/java/me/zhanghai/android/files/provider/ftp/client/Protocol.kt +++ b/app/src/main/java/me/zhanghai/android/files/provider/ftp/client/Protocol.kt @@ -14,9 +14,9 @@ enum class Protocol(val scheme: String, val defaultPort: Int, val createClient: FTPES("ftpes", FTPClient.DEFAULT_PORT, { FTPSClient(false) }); companion object { - val SCHEMES = values().map { it.scheme } + val SCHEMES = entries.map { it.scheme } fun fromScheme(scheme: String): Protocol = - values().firstOrNull() { it.scheme == scheme } ?: throw IllegalArgumentException(scheme) + entries.firstOrNull { it.scheme == scheme } ?: throw IllegalArgumentException(scheme) } }