[libcxx-commits] [PATCH] D133663: [libc++][chrono] Implements formatter year.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 4 10:07:40 PDT 2022


Mordante marked 5 inline comments as done.
Mordante added a comment.

Thanks for the review!



================
Comment at: libcxx/include/__chrono/formatter.h:62-64
+_LIBCPP_HIDE_FROM_ABI void __format_year_last_two_digits(int __year, basic_stringstream<_CharT>& __sstr) {
+  __sstr << std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:02}"), (std::abs(__year + 1900)) % 100);
+}
----------------
ldionne wrote:
> Since this is used in a single place, any reason not to inline it where it's used?
As discussed I prefer to keep code in switch statements short. However since this is a one-liner I moved it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133663



More information about the libcxx-commits mailing list