[PATCH] D98167: Avoid shuffle self-assignment in EXPENSIVE_CHECKS builds

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 9 10:57:09 PST 2021


RKSimon added inline comments.


================
Comment at: llvm/include/llvm/ADT/STLExtras.h:1339
+    difference_type offset = g() % size;
+    if (offset != difference_type(0))
+      std::iter_swap(first, first + offset);
----------------
arichardson wrote:
> lebedev.ri wrote:
> > This should have a comment explaining why this is needed
> Will add a comment if we are happy to proceed with this patch.
> How about the following?
Yes that sounds ok to me


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98167



More information about the llvm-commits mailing list