Skip to content

Avoid using strlen to get return size#326

Merged
mborland merged 1 commit intocppalliance:developfrom
pps83:develop-tostr
Feb 16, 2026
Merged

Avoid using strlen to get return size#326
mborland merged 1 commit intocppalliance:developfrom
pps83:develop-tostr

Conversation

@pps83
Copy link
Contributor

@pps83 pps83 commented Feb 14, 2026

  • leave output buffer unset

 + leave output buffer unset
@pps83 pps83 changed the title Develop tostr Avoid using strlen to get return size Feb 14, 2026
char buffer[64];
const auto last {detail::mini_to_chars(buffer, value, 10, false)};
return std::string{last};
return std::string{last, buffer + sizeof(buffer)};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

perhaps, a comment explaining that mini_to_chars outputs in from the end of the buffer?

@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.03%. Comparing base (631c8fc) to head (57633ca).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #326      +/-   ##
===========================================
- Coverage    99.03%   99.03%   -0.01%     
===========================================
  Files           64       64              
  Lines         5403     5402       -1     
  Branches      1686     1686              
===========================================
- Hits          5351     5350       -1     
  Misses          21       21              
  Partials        31       31              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mborland mborland merged commit ac9b668 into cppalliance:develop Feb 16, 2026
74 of 76 checks passed
@pps83 pps83 deleted the develop-tostr branch February 16, 2026 17:27
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