Re: [PATCH v2 5/7] name-hash: perf improvement for lazy_init_name_hash
- From
- Jeff Hostetler <git@jeffhostetler.com>
- Date
- Mar 24, 2017, 12:36 UTC
- Message-ID
- <89375f59-8716-3ddc-b163-5669452273c5@jeffhostetler.com>
- In-Reply-To
- <CAGZ79kZKri4jsnGCWhpV_WjSef5DxSwMTxYOour9kjzTWOFcxA@mail.gmail.com>
On 3/23/2017 1:45 PM, Stefan Beller wrote:
Show 17 quoted lines
> On Thu, Mar 23, 2017 at 8:25 AM, Ramsay Jones
> <ramsay@ramsayjones.plus.com> wrote:
>>> + /*
>>> + * Either we have a parent directory and path with slash(es)
>>> + * or the directory is an immediate child of the root directory.
>>> + */
>>> + assert((parent != NULL) ^ (strchr(prefix->buf, '/') == 0));
>>
>
> Also this seems part of the actual shipped code, not testing code.
> In that case we prefer
>
> if (<condition>)
> die("BUG: <description>");
>
> This is because asserts may be omitted by the compiler,
> when compiled with NDEBUG.I mainly wrote that for myself while testing. Now that I'm past that, I'm comfortable removing it completely or converting it to an actual if-die.
Jeff