Skip to content

Conversation

@mdumandag
Copy link
Contributor

See the individual commit messages for the explanation.

@mdumandag mdumandag added this to the 4.0 milestone Nov 11, 2020
@mdumandag mdumandag self-assigned this Nov 11, 2020
For integers, unless the user configures the default int type,
it will be 4 bytes integer. Therefore, we first check the default
setting while looking for serailizer for integer types.
It is not necessary to create a new buffer on `to_byte_array` method
before returning. `buffer[:pos]` already creates a copy.
There were checks that assume Data's buffer might be None
but this is not possible. Data might have a buffer of length
0, but it can never be None.

This commit removes such checks.
We initialize the buffer at the constructor and never set it to
None on any of the code paths. Therefore, None checks are not
necessary.
@mdumandag mdumandag force-pushed the serialization-service-improvments branch from d34f62f to 61a0f8f Compare November 18, 2020 12:47
There is no need to check for int type id on each lookup_default_serializer
call. However, this is required for VAR size option.
@puzpuzpuz puzpuzpuz self-requested a review November 19, 2020 11:01
Copy link

@puzpuzpuz puzpuzpuz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mdumandag
Copy link
Contributor Author

Thanks for the review Andrey

@mdumandag mdumandag merged commit 41df2ab into hazelcast:master Nov 19, 2020
@mdumandag mdumandag deleted the serialization-service-improvments branch November 19, 2020 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants