Skip to content

Commit 0b0b8cd

Browse files
Miklos Vajnagitster
authored andcommitted
CodingGuidelines: Add a note to avoid assignments inside if()
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 633f43e commit 0b0b8cd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Documentation/CodingGuidelines

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ For C programs:
8989
of "else if" statements, it can make sense to add braces to
9090
single line blocks.
9191

92+
- We try to avoid assignments inside if().
93+
9294
- Try to make your code understandable. You may put comments
9395
in, but comments invariably tend to stale out when the code
9496
they were describing changes. Often splitting a function

0 commit comments

Comments
 (0)