lemire/FastPFor

Suspicious operation with unused side-effects

Closed this issue · 1 comments

https://github.com/lemire/FastPFor/blob/master/headers/util.h#L240

In this snippet:

  if (v >= (1U << 0)) {
    v >>= 1;
    r += 1;
  }

v is modified but isn't used anymore. I suppose it's just because of copy-pasting from other cases and it was overlooked. Still, want to make sure. And if it's in fact unnecessary, it would be good to remove to avoid any confusion/warnings.

Also, am I missing something, or the condition could just be v >= 1U?

You are correct: pull request invited.