[Lldb-commits] [lldb] r331415 - [NSDictionary] Simplify the formatter. NFCI.
Davide Italiano via lldb-commits
lldb-commits at lists.llvm.org
Wed May 2 16:56:58 PDT 2018
On Wed, May 2, 2018 at 4:51 PM, Jason Molenda via lldb-commits
<lldb-commits at lists.llvm.org> wrote:
> Is this really simpler? We could write it
>
> if (name == g_zero)
> return 0;
> else
> return UINT32_MAX;
>
> or we could do it that way, or it could be done the way it was originally written.
>
> tbh it seems like a style choice, and whoever wrote it originally may have preferred it being expressed that way. I can understand that you prefer it be expressed this way - but it's not actually any better or more readable, is it? Certainly the compiler is going to turn any variation we can come up with into the same instructions.
>
Oh, I guess I should've said "make this code shorter" or something :)
We end up preferring ternary in llvm whenever possible, and I just
followed what was used there.
I largely agree it's a stylistic choice, FWIW.
--
Davide
More information about the lldb-commits
mailing list