File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
src/main/kotlin/com/fasterxml/jackson/module/kotlin Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ Contributors:
18
18
# 2 .16.0 (not yet released)
19
19
20
20
WrongWrong (@k163377 )
21
+ * #685 : Streamline default value management for KotlinFeatures
21
22
* #684 : Update Kotlin Version to 1.6
22
23
* #682 : Remove MissingKotlinParameterException and replace with MismatchedInputException
23
24
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ Co-maintainers:
18
18
19
19
2.16 .0 (not yet released )
20
20
21
+ #685 : Streamline default value management for KotlinFeatures .
22
+ This improves the initialization cost of kotlin - module a little .
21
23
#684 : Kotlin 1.5 has been deprecated and the minimum supported Kotlin version will be updated to 1.6.
22
24
#682 : Remove MissingKotlinParameterException and replace with MismatchedInputException
23
25
This change removes MissingKotlinParameterException and resolves #617 .
Original file line number Diff line number Diff line change @@ -44,12 +44,12 @@ enum class KotlinFeature(private val enabledByDefault: Boolean) {
44
44
*/
45
45
StrictNullChecks (enabledByDefault = false );
46
46
47
- internal val bitSet: BitSet = 2.0 .pow( ordinal).toInt( ).toBitSet()
47
+ internal val bitSet: BitSet = ( 1 shl ordinal).toBitSet()
48
48
49
49
companion object {
50
50
internal val defaults
51
- get() = 0 .toBitSet ().apply {
52
- values().filter { it .enabledByDefault }.forEach { or (it .bitSet) }
51
+ get() = values ().fold( BitSet ( Int . SIZE_BITS )) { acc, cur ->
52
+ acc. apply { if (cur .enabledByDefault) this . or (cur .bitSet) }
53
53
}
54
54
}
55
55
}
You can’t perform that action at this time.
0 commit comments