[libcxx-commits] [PATCH] D67273: [libc++] Remove unnecessary assignment in exclusive_scan

Marek Kurdej via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 25 02:54:11 PST 2020


curdeius added inline comments.


================
Comment at: libcxx/include/numeric:311
     {
-        _Tp __saved = __init;
-        do
+        _Tp __tmp(__b(__init, *__first));
+        while (true)
----------------
Wouldn't you want to move this line into the loop, and so remove the assignment to `__tmp` at the end of the loop?
It will remove code duplication and should be the same performance-wise.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67273



More information about the libcxx-commits mailing list