[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 19:10:21 PDT 2021


gAlfonso-bit updated this revision to Diff 360685.
gAlfonso-bit added a comment.

Really trying to please the linter here


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,8 +1363,8 @@
   // 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) {
-    difference_type offset = g() % size;
+  for (auto 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).
     if (offset != difference_type(0))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106320.360685.patch
Type: text/x-patch
Size: 740 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210722/3edb24a1/attachment.bin>


More information about the llvm-commits mailing list