File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
src/main/kotlin/com/fasterxml/jackson/module/kotlin Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -52,24 +52,17 @@ internal class ArgumentBucket(
52
52
private fun getMaskAddress (index : Int ): Pair <Int , Int > = (index / Int .SIZE_BITS ) to (index % Int .SIZE_BITS )
53
53
54
54
/* *
55
- * The set argument process, similar to MutableMap's put.
56
- * @return the previous value associated with the key, or `null` if the key was not present in the map.
55
+ * Set the argument. The second and subsequent inputs for the same `index` will be ignored.
57
56
*/
58
- operator fun set (index : Int , value : Any? ): Any? {
57
+ operator fun set (index : Int , value : Any? ) {
59
58
val maskAddress = getMaskAddress(index)
60
59
61
60
val updatedMask = masks[maskAddress.first] and BIT_FLAGS [maskAddress.second]
62
61
63
- return if (updatedMask != masks[maskAddress.first]) {
64
- // If the argument has not been initialized, it counts up and returns null.
62
+ if (updatedMask != masks[maskAddress.first]) {
65
63
values[index] = value
66
64
masks[maskAddress.first] = updatedMask
67
65
initializedCount++
68
-
69
- null
70
- } else {
71
- // If it has been initialized, it swaps the values and returns the previous value.
72
- values[index].apply { values[index] = value }
73
66
}
74
67
}
75
68
You can’t perform that action at this time.
0 commit comments