This is semantically equivalent because threadshold is unsigned, so this proposed change should have zero effect on the code.
However, I believe that it is slightly more legible/simple this way. Reasoning about threshold_ <= owners_.length && threshold_ >= 0 is easier than reasoning about threshold_ <= owners_.length && threshold_ != 0 because you don't have to think about threshold's type. The semantic we are trying to check is is that threashold is within the range [0, owners_.length), and I believe my suggestion captures this semantic slightly better.
This is semantically equivalent because threadshold is unsigned, so this proposed change should have zero effect on the code.
However, I believe that it is slightly more legible/simple this way. Reasoning about
threshold_ <= owners_.length && threshold_ >= 0
is easier than reasoning aboutthreshold_ <= owners_.length && threshold_ != 0
because you don't have to think about threshold's type. The semantic we are trying to check is is that threashold is within the range[0, owners_.length)
, and I believe my suggestion captures this semantic slightly better.