From f74f3046e23fae5ea44c32bc8b435ef65171295b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Fri, 31 Dec 2021 19:22:49 +0100 Subject: [PATCH] contributing: Clarify the if (value == 0) guideline --- Contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contributing.md b/Contributing.md index ce440511..eb5394b3 100644 --- a/Contributing.md +++ b/Contributing.md @@ -119,7 +119,7 @@ This will allow your contributions to be reviewed more quickly. * Use 4 spaces to indent. * 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. -* 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. ### Header files