diff options
-rw-r--r-- | DOCS/contribute.md | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/DOCS/contribute.md b/DOCS/contribute.md index 9fc9d8d8bc..994e2040c1 100644 --- a/DOCS/contribute.md +++ b/DOCS/contribute.md @@ -101,18 +101,16 @@ mpv uses C99 with K&R formatting, with some exceptions. do_something(); } ``` -- If the body of an if statement uses braces, the else branch should also - use braces (and reverse). +- If the if has an else branch, both branches should use braces, even if they're + technically redundant. Example: ```C if (a) { - // do something - something(); - something_else(); - } else { one_line(); + } else { + one_other_line(); } ``` - If an if condition spans multiple physical lines, then put the opening brace |