Re: [PATCH 10/44] connect: add function to detect supported v1 hash functions
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- May 13, 2020, 22:49 UTC
- Message-ID
- <20200513224912.GE6605@camp.crustytoothpaste.net>
- In-Reply-To
- <CAN0heSosiP=vCcd1QBmWNsVUuHTmRJbjGrWV9tU0=BSU1ENmDQ@mail.gmail.com>
On 2020-05-13 at 19:39:41, Martin Ågren wrote:
Show 12 quoted lines
> On Wed, 13 May 2020 at 02:56, brian m. carlson
> <sandals@crustytoothpaste.net> wrote:
> > + while (hash) {
> > + if (!xstrncmpz(desired, hash, len))
> > + found = 1;
> > +
> > + if (found)
> > + return 1;
>
> I first thought this structure was because this loop body would learn to
> do something else later in the series. But this is it. This looks like
> it could just be "if (!xstrncmpz(...)) return 1;" and drop "found".Yeah, I think it could. I originally didn't have the helper and the code was pretty hideous, so I probably forgot to simplify when I used the helper again.
-- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204