Replace if-statements with `if constexpr` statements
Summary: We have found that BitVectorCoding.h incorrectly outputs -Wdivision-by-zero errors when another file that includes it fails to compile. In the absence of other compilation errors, the -Wdivision-by-zero error does not appear (since the compiler correctly can tell that "division by zero" is not an issue in the code). In order to get rid of these erroneous error logs, we decided to replace the if-statements that surround the divisions (and check that the divisor is not zero) with `if constexpr` statements since those will stop the compiler from mistakenly thinking that division by zero is possible. Reviewed By: ot, philippv, luciang Differential Revision: D26961916 fbshipit-source-id: f65ef6d7782c94e58d6d28b9f8b053f205e3b7c1
Showing
Please register or sign in to comment