The external to_chars interface does some validations already done in
format. So instead of doing the same validations again, directly call
the internals of to_chars.
This has a small size benefit
text data bss dec hex filename 718800 12472 488 731760 b2a70 ./formatter_int.libcxx.out-baseline 714915 12472 488 727875 b1b43 ./formatter_int.libcxx.out
And a small performance benefit for simple formatting:
Comparing ./formatter_int.libcxx.out-baseline to ./formatter_int.libcxx.out Benchmark Time CPU Time Old Time New CPU Old CPU New ---------------------------------------------------------------------------------------------------------------------------------------------------- BM_Basic<uint32_t> -0.1139 -0.1125 61 54 61 54 BM_Basic<int32_t> -0.0265 -0.0250 62 60 62 60 BM_Basic<uint64_t> +0.0051 +0.0069 82 83 82 83 BM_Basic<int64_t> +0.0084 +0.0101 82 83 82 83 BM_BasicLow<__uint128_t> -0.0588 -0.0572 87 82 87 82 BM_BasicLow<__int128_t> -0.0548 -0.0532 88 83 88 83 BM_Basic<__uint128_t> -0.0253 -0.0238 239 233 238 233 BM_Basic<__int128_t> -0.0346 -0.0331 222 214 222 214