Skip to content

cleanup writeString()#55

Merged
hmueller01 merged 1 commit intomasterfrom
cleanup-writeString
Jul 13, 2025
Merged

cleanup writeString()#55
hmueller01 merged 1 commit intomasterfrom
cleanup-writeString

Conversation

@hmueller01
Copy link
Copy Markdown
Owner

Removed writeString(const char* string, uint8_t* buf, size_t pos) by using writeString(const char* string, uint8_t* buf, size_t pos, size_t size) all over.

This reduces stack consumption and avoids potential errors if called with another buffer that this->buffer.

… writeString(const char* string, uint8_t* buf, size_t pos, size_t size)
@hmueller01 hmueller01 merged commit da55d5f into master Jul 13, 2025
1 check passed
@hmueller01 hmueller01 deleted the cleanup-writeString branch July 13, 2025 09:24
@TD-er
Copy link
Copy Markdown
Collaborator

TD-er commented Jul 13, 2025

writeString is a private member function and every call made to it is given the member variable of the buffer size.
So why not just use the member variable within that function?

@hmueller01
Copy link
Copy Markdown
Owner Author

ATM always this->buffer is used, so this->buffer_size is always the max length. So yes, the member could be stripped by the two variables ...
@TD-er Do you need it for your “new" buffer algorithm? BTW, when does you PR come? ;-)

@hmueller01 hmueller01 mentioned this pull request Jul 19, 2025
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.

2 participants