Skip to content

Commit

Permalink
Merge pull request #700 from k163377/remove-is-assignable
Browse files Browse the repository at this point in the history
Reduce the load on the search process for serializers
  • Loading branch information
k163377 authored Aug 11, 2023
2 parents 9730a1b + 374cf40 commit dad40ec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ kkurczewski
* #689: Add KotlinDuration support

WrongWrong (@k163377)
* #700: Reduce the load on the search process for serializers
* #687: Optimize and Refactor KotlinValueInstantiator.createFromObjectWith
* #686: Add KotlinPropertyNameAsImplicitName option
* #685: Streamline default value management for KotlinFeatures
Expand Down
1 change: 1 addition & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Co-maintainers:

2.16.0 (not yet released)

#700: Reduce the load on the search process for serializers.
#689: Added UseJavaDurationConversion feature.
By enabling this feature and adding the Java Time module, Kotlin Duration can be handled in the same way as Java Duration.
#687: Optimize and Refactor KotlinValueInstantiator.createFromObjectWith.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ internal class KotlinSerializers : Serializers.Base() {
val rawClass = type.rawClass

return when {
UByte::class.java.isAssignableFrom(rawClass) -> UByteSerializer
UShort::class.java.isAssignableFrom(rawClass) -> UShortSerializer
UInt::class.java.isAssignableFrom(rawClass) -> UIntSerializer
ULong::class.java.isAssignableFrom(rawClass) -> ULongSerializer
UByte::class.java == rawClass -> UByteSerializer
UShort::class.java == rawClass -> UShortSerializer
UInt::class.java == rawClass -> UIntSerializer
ULong::class.java == rawClass -> ULongSerializer
// The priority of Unboxing needs to be lowered so as not to break the serialization of Unsigned Integers.
rawClass.isUnboxableValueClass() -> ValueClassSerializer.from(rawClass)
else -> null
Expand Down

0 comments on commit dad40ec

Please sign in to comment.