diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2025-03-27 11:52:59 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-03-28 17:38:10 -0700 |
commit | be7a517ce4606b46479fe06fae6c1ab117b0d384 (patch) | |
tree | 7f049a1f43555b9f654a518be87d7e0b173cc820 /compat/regex/regex_internal.c | |
parent | 324fbaab88126196bd42e7fa383ee94e165d61b5 (diff) |
diff-delta: avoid using the comma operator
The comma operator is a somewhat obscure C feature that is often used by
mistake and can even cause unintentional code flow. That is why the
`-Wcomma` option of clang was introduced: To identify unintentional uses
of the comma operator.
Intentional uses include situations where one wants to avoid curly
brackets around multiple statements that need to be guarded by a
condition. This is the case here, as the repetitive nature of the
statements is easier to see for a human reader this way. At least in my
opinion.
However, opinions on this differ wildly, take 10 people and you have 10
different preferences.
On the Git mailing list, it seems that the consensus is to use the long
form instead, so let's do just that.
Suggested-by: Phillip Wood <phillip.wood123@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/regex/regex_internal.c')
0 files changed, 0 insertions, 0 deletions