Just write

    b = b | 0;

instead of the if clause