KT-53327 replace Enum.values() with Enum.entries in CharCategory
Also, replace it in stdlib tests where appropriate and disable already unsupported legacy JS tests ^KT-53327 fixed Co-authored-by: Artem Kobzar <Artem.Kobzar@jetbrains.com> Merge-request: KT-MR-10632 Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
This commit is contained in:
committed by
Space Team
parent
c867a4b52f
commit
175cf5e833
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -165,8 +165,8 @@ public actual enum class CharCategory(internal val value: Int, public actual val
|
||||
companion object {
|
||||
internal fun valueOf(category: Int): CharCategory =
|
||||
when (category) {
|
||||
in 0..16 -> values()[category]
|
||||
in 18..30 -> values()[category - 1]
|
||||
in 0..16 -> entries[category]
|
||||
in 18..30 -> entries[category - 1]
|
||||
else -> throw IllegalArgumentException("Category #$category is not defined.")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user