Re: none
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Apr 11, 2016, 19:18 UTC
- Message-ID
- <vpq37qsosyf.fsf@anie.imag.fr>
- In-Reply-To
- <001a11492f107354a305303a369a@google.com>
miwilliams@google.com writes:
Show 9 quoted lines
> From 7201fe08ede76e502211a781250c9a0b702a78b2 Mon Sep 17 00:00:00 2001 > From: Mike Williams <miwilliams@google.com> > Date: Mon, 11 Apr 2016 14:18:39 -0400 > Subject: [PATCH 1/1] wt-status: Remove '!!' from > wt_status_collect_changed_cb > > The wt_status_collect_changed_cb function uses an extraneous double > negation (!!) > when determining whether or not a submodule has new commits.
It's not just a double negation, it's a way to ensure that the value is 0 or 1 (it's a relatively common idiom in C at least in Git's codebase).
new_submodule_commits is a 1-bit bitfield, and you don't want to assign anything other than 1 or 0 (or you'll get modulo 2^n semantics, with n==1).
So the old code is correct and your patch would introduce a bug.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/