There is no problem with the code I'm just curious. I have this code I'm looking at and I'm trying to figure out why they do bitwise and and not just a regular &&
bool bValid = true;
.... // some code here
bValid &= IsASMConfigurationValid(this.m_ThisDevices[BDCASM], ref el);
.... // more code here
bValid &= IsSPEConfigurationValid(this.m_ThisDevices[BDCSPE], ref el);
I just want to know why this did this instead of just setting bValid = to IsConfigValid. This could very well be just his coding style.
I can see some options:
&=
to avoid writing it again.Remember that there is no bitwise operation for bool
operand, so its just a logical AND.
All are very personal, the best answer will come from the real developer.