Replace deprecated toMap usages with toMapBy
This commit is contained in:
@@ -161,7 +161,7 @@ public enum class CharCategory(public val value: Int, public val code: String) {
|
||||
|
||||
|
||||
public companion object {
|
||||
private val categoryMap by lazy { CharCategory.values().toMap { it.value } }
|
||||
private val categoryMap by lazy { CharCategory.values().toMapBy { it.value } }
|
||||
|
||||
public fun valueOf(category: Int): CharCategory = categoryMap[category] ?: throw IllegalArgumentException("Category #$category is not defined.")
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public enum class CharDirectionality(public val value: Int) {
|
||||
|
||||
|
||||
public companion object {
|
||||
private val directionalityMap by lazy { CharDirectionality.values().toMap { it.value } }
|
||||
private val directionalityMap by lazy { CharDirectionality.values().toMapBy { it.value } }
|
||||
|
||||
public fun valueOf(directionality: Int): CharDirectionality = directionalityMap[directionality] ?: throw IllegalArgumentException("Directionality #$directionality is not defined.")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user