Skip to content

buffer: allow to write zero bytes #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2025

Conversation

drewdzzz
Copy link
Collaborator

@drewdzzz drewdzzz commented Jul 16, 2025

Encoder can try to write zero bytes sometimes. For example, when it encodes an empty string. Let's simply handle this case in buffer and iterators instead of assertion.

Along the way, replace the assertion in iterator::get method as well. It should have be done in 28bae01, but we forgot about this method because it's not used by decoder.

Part of #93 reincarnation.

@drewdzzz drewdzzz force-pushed the buffer_empty_write branch 3 times, most recently from 9adadd2 to 64e8d15 Compare July 16, 2025 13:37
@drewdzzz drewdzzz self-assigned this Jul 16, 2025
@drewdzzz drewdzzz assigned mkostoevr and CuriousGeorgiy and unassigned drewdzzz Jul 16, 2025
@mkostoevr mkostoevr removed their assignment Jul 25, 2025
Encoder can try to write zero bytes sometimes. For example, when
it encodes an empty string. Let's simply handle this case in buffer
and iterators instead of assertion.

Along the way, replace the assertion in `iterator::get` method as well.
It should have be done in 28bae01, but we forgot about this method
because it's not used by decoder.

Co-authored-by: Andrey Saranchin <[email protected]>
@drewdzzz drewdzzz force-pushed the buffer_empty_write branch from 64e8d15 to 399aabd Compare July 30, 2025 15:31
@drewdzzz drewdzzz merged commit a3d0414 into tarantool:master Aug 12, 2025
96 of 97 checks passed
@drewdzzz drewdzzz deleted the buffer_empty_write branch August 12, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants