[PATCH] D106320: [LLVM] Remove (void) in loop as it is unnecessary and confusing

Alf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 21 16:43:30 PDT 2021


gAlfonso-bit updated this revision to Diff 360642.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106320

Files:
  llvm/include/llvm/ADT/STLExtras.h


Index: llvm/include/llvm/ADT/STLExtras.h
===================================================================
--- llvm/include/llvm/ADT/STLExtras.h
+++ llvm/include/llvm/ADT/STLExtras.h
@@ -1363,7 +1363,7 @@
   // but that would be stdlib dependent.
   typedef
       typename std::iterator_traits<Iterator>::difference_type difference_type;
-  for (auto size = last - first; size > 1; ++first, (void)--size) {
+  for (difference_type size = last - first; size > 1; --size, ++first) {
     difference_type offset = g() % size;
     // Avoid self-assignment due to incorrect assertions in libstdc++
     // containers (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85828).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106320.360642.patch
Type: text/x-patch
Size: 670 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210721/dea1a1e0/attachment.bin>


More information about the llvm-commits mailing list