From 215e7d6f8b7927db345ae272a9afcf8f59cdeb4b Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Sun, 15 Dec 2024 23:33:16 +0900 Subject: [PATCH 1/2] Replaced Enum.values with Enum.entries --- .../kotlin/com/fasterxml/jackson/module/kotlin/KotlinFeature.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinFeature.kt b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinFeature.kt index bbbbbc24..52512e6d 100644 --- a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinFeature.kt +++ b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinFeature.kt @@ -72,7 +72,7 @@ enum class KotlinFeature(internal val enabledByDefault: Boolean) { companion object { internal val defaults - get() = values().fold(BitSet(Int.SIZE_BITS)) { acc, cur -> + get() = entries.fold(BitSet(Int.SIZE_BITS)) { acc, cur -> acc.apply { if (cur.enabledByDefault) this.or(cur.bitSet) } } } From 898ee9e0da2ba8208fc8e1f3db5c0d80f31a5044 Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Sun, 15 Dec 2024 23:36:38 +0900 Subject: [PATCH 2/2] Update release notes wrt #869 --- release-notes/CREDITS-2.x | 1 + release-notes/VERSION-2.x | 1 + 2 files changed, 2 insertions(+) diff --git a/release-notes/CREDITS-2.x b/release-notes/CREDITS-2.x index 5013320f..c7b7f3b4 100644 --- a/release-notes/CREDITS-2.x +++ b/release-notes/CREDITS-2.x @@ -28,6 +28,7 @@ WrongWrong (@k163377) # 2.18.0 (26-Sep-2024) WrongWrong (@k163377) +* #869: Replaced Enum.values with Enum.entries * #818: Optimize the search process for creators * #817: Fixed nullability of convertValue function argument * #782: Organize deprecated contents diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index 3cb0111e..b7bab23f 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -18,6 +18,7 @@ Co-maintainers: 2.19.0 (not yet released) +#869: By using Enum.entries in the acquisition of KotlinFeature.defaults, the initialization load was reduced, albeit slightly. #861: Kotlin has been upgraded to 1.9.24. #858: Minor performance improvement of findDefaultCreator in edge cases. #839: Remove useKotlinPropertyNameForGetter and unify with kotlinPropertyNameAsImplicitName.