[PATCH] D106320: Remove (void) in loop as it is unnecessary and confusing
Alf via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 20 13:41:17 PDT 2021
gAlfonso-bit updated this revision to Diff 360256.
gAlfonso-bit added a comment.
did a decrement after size is used so clang format doesn’t complain
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; ++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.360256.patch
Type: text/x-patch
Size: 734 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210720/4d115825/attachment.bin>
More information about the llvm-commits
mailing list