-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add Format option for buffer writers and string builders #27572
Merged
andy31415
merged 10 commits into
project-chip:master
from
andy31415:format_in_string_builder
Jul 4, 2023
Merged
Add Format option for buffer writers and string builders #27572
andy31415
merged 10 commits into
project-chip:master
from
andy31415:format_in_string_builder
Jul 4, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pullapprove
bot
requested review from
amitnj,
anush-apple,
arkq,
bzbarsky-apple,
carol-apple,
cecille,
chrisdecenzo,
chshu,
chulspro,
cliffamzn,
Damian-Nordic,
dhrishi,
electrocucaracha,
emargolis,
gjc13,
harsha-rajendran,
hawk248,
jelderton,
jepenven-silabs,
jmartinez-silabs,
jmeg-sfy,
joonhaengHeo,
jtung-apple,
kcoppock,
kkasperczyk-no,
ksperling-apple and
lazarkov
June 30, 2023 13:11
pullapprove
bot
requested review from
tcarmelveilleux,
tecimovic,
turon,
vijs,
vivien-apple,
woody-apple,
xylophone21,
younghak-hwang,
yufengwangca and
yunhanw-google
June 30, 2023 13:11
PR #27572: Size comparison from 757f06a to bab79ac Increases (7 builds for bl702, bl702l, cc32xx, mbed, nrfconnect)
Decreases (4 builds for bl602, cc32xx, nrfconnect)
Full report (12 builds for bl602, bl702, bl702l, cc32xx, mbed, nrfconnect, qpg)
|
tcarmelveilleux
approved these changes
Jun 30, 2023
PR #27572: Size comparison from 757f06a to 2077d6b Increases (18 builds for bl702, bl702l, cc32xx, efr32, esp32, mbed, nrfconnect, psoc6, telink)
Decreases (28 builds for bl602, bl702, bl702l, cc32xx, esp32, linux, nrfconnect, psoc6, qpg, telink)
Full report (58 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
yufengwangca
approved these changes
Jun 30, 2023
PR #27572: Size comparison from 757f06a to e84e25f Increases (21 builds for bl702, bl702l, cc32xx, efr32, esp32, mbed, nrfconnect, psoc6, telink)
Decreases (29 builds for bl602, bl702, bl702l, cc32xx, esp32, linux, psoc6, telink)
Full report (58 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
Damian-Nordic
approved these changes
Jul 3, 2023
Co-authored-by: Damian Królik <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am working on debuggability and very often I have to format output data. Using snprintf or sizing buffers just right is really time consuming, StringBuilder is a much better abstraction, similar to sstream (but not as heavy).
This adds a
AddFormat
to StringBuilder (and Format to BufferWriter which it uses underneath) that does what you would expect. Includes unit tests.