[libcxx-commits] [PATCH] D63047: [libc++] Fix leading zeros in std::to_chars

Zhihao Yuan via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jun 9 00:50:59 PDT 2019


lichray accepted this revision.
lichray added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libcxx/src/charconv.cpp:136
 
-        if (a < 100)
-        {
-            if (a < 10)
-                buffer = append1(buffer, a);
-            else
-                buffer = append2(buffer, a);
-        }
-        else
-        {
-            if (a < 1000)
-                buffer = append3(buffer, a);
-            else
-                buffer = append4(buffer, a);
-        }
+        buffer = append4_no_zeros(buffer, a);
 
----------------
ivafanas wrote:
> lichray wrote:
> > Can you keep the empty line after this line?
> Do not understand, sorry.
> There are already empty lines before and after `buffer = append4_no_zeros(buffer, a);`
This revision is good, don't worry.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63047/new/

https://reviews.llvm.org/D63047





More information about the libcxx-commits mailing list