Replace deprecated toMap usages with toMapBy

This commit is contained in:
Ilya Gorbunov
2015-11-30 04:00:31 +03:00
parent f107559a3c
commit ea60ab74a7
11 changed files with 13 additions and 13 deletions
@@ -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.")
}