Thread (94 messages) 94 messages, 4 authors, 2021-01-14

Re: [PATCH 00/20] pack-revindex: prepare for on-disk reverse index

flat view

From: Derrick Stolee <hidden>
Date: 2021-01-11 17:16:53

On 1/11/2021 11:30 AM, Taylor Blau wrote:
On Mon, Jan 11, 2021 at 07:07:17AM -0500, Derrick Stolee wrote:
quoted
My comments on this series are very minor.

I made only one comment about "if (method() < 0)" versus
"if (method())" but that pattern appears in multiple patches.
_If_ you decide to change that pattern, then I'm sure you can
find all uses.
I have no strong opinion here, so I'm happy to defer to your or others'
judgement. My very weak opinion is that I'd just as soon leave it as-is,
but that if I'm rerolling and others would like to see it changed, then
I'm happy to do it.
Well, I found 782 instances of ") < 0)" in the codebase, and my initial
scan of these shows they are doing exactly what you are asking. So as
far as code style goes, there is plenty of precedent.

The thing that makes me react to this is that it _looks_ like an extra
comparison. However, I'm sure the assembly instructions have the same
performance characteristics between "!= 0" and "< 0".

Thanks,
-Stolee
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help