[PATCH] D77985: Fix bug in SmallBitVector::find_next_unset

Brad Moody via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 21 17:21:15 PDT 2020


bmoody marked an inline comment as done.
bmoody added a comment.

Great!  Please commit this on my behalf, as I don't have commit access.  Thanks.



================
Comment at: llvm/include/llvm/ADT/SmallBitVector.h:296
 
       if (Bits == ~uintptr_t(0) || Prev + 1 >= getSmallSize())
         return -1;
----------------
dantrushin wrote:
> Wouldn't it be simpler to leave `++Prev` from line 290 in place and then just use `Prev` ?
IMO modifying parameter values can make code more confusing at a glance, so I try to avoid it.  But the main reason I did this was to make the code as close to the find_next implementation above as possible.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77985





More information about the llvm-commits mailing list