<charconv>: small optimization of _Integer_to_chars for bases 3,6,5,7,9#1622
<charconv>: small optimization of _Integer_to_chars for bases 3,6,5,7,9#1622StephanTLavavej merged 1 commit intomicrosoft:mainfrom
Conversation
StephanTLavavej
left a comment
There was a problem hiding this comment.
Thanks! I'm not sure whether these bases are used in practice, but this change is simple and clearly correct (we also have extensive test coverage for all bases).
(Further optimizing these unusual bases probably wouldn't be worth additional code complexity - all code has a maintenance cost - but the cost here is essentially zero.)
(It's unfortunate that the Standard doesn't provide the base as a template argument, which would allow us to use if constexpr in the default case.)
|
Thanks for optimizing my favorite header, and congratulations on your first microsoft/STL commit! 🎉 🚀 😸 |
|
Thanks! |
In case the base is less than 10 it is correct to calculate the digit by adding it to
'0'instead of looking it up in the table. This is a small optimization