Skip to content

Commit

Permalink
Use entries instead of values as its recommended after kotlin 1.9 (#3718
Browse files Browse the repository at this point in the history
)

Use entries instead of values as its  recommended after kotlin 1.9
  • Loading branch information
CodeWithTamim authored Oct 21, 2024
1 parent 22cef29 commit 5a5f911
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ enum class EConfigType(val value: Int, val protocolScheme: String) {
HTTP(10, AppConfig.HTTP);

companion object {
fun fromInt(value: Int) = values().firstOrNull { it.value == value }
fun fromInt(value: Int) = entries.firstOrNull { it.value == value }
}
}
2 changes: 1 addition & 1 deletion V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/JsonUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object JsonUtil {
val gsonPre = GsonBuilder()
.setPrettyPrinting()
.disableHtmlEscaping()
.registerTypeAdapter( // custom serialiser is needed here since JSON by default parse number as Double, core will fail to start
.registerTypeAdapter( // custom serializer is needed here since JSON by default parse number as Double, core will fail to start
object : TypeToken<Double>() {}.type,
JsonSerializer { src: Double?, _: Type?, _: JsonSerializationContext? ->
JsonPrimitive(
Expand Down

0 comments on commit 5a5f911

Please sign in to comment.