contributing: Clarify the if (value == 0) guideline

This commit is contained in:
Léo Lam 2021-12-31 19:22:49 +01:00
parent cc83099e31
commit f74f3046e2
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
1 changed files with 1 additions and 1 deletions

View File

@ -119,7 +119,7 @@ This will allow your contributions to be reviewed more quickly.
* Use 4 spaces to indent. * Use 4 spaces to indent.
* Use `nullptr`, not `NULL` or `0`. * Use `nullptr`, not `NULL` or `0`.
* Only use `auto` if the variable type is obvious, too long to type or if it doesn't matter. * Only use `auto` if the variable type is obvious, too long to type or if it doesn't matter.
* To compare a value against zero, write `if (value == 0)`, not `if (!value)`. * To compare an integer against zero, write `if (value == 0)`, not `if (!value)`. (This rule doesn't apply to booleans.)
* To compare a value against nullptr, either `if (pointer != nullptr)` or `if (pointer)` is fine. * To compare a value against nullptr, either `if (pointer != nullptr)` or `if (pointer)` is fine.
### Header files ### Header files