<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jun 29, 2015 at 3:09 PM, Peter Hutterer <span dir="ltr"><<a href="mailto:peter.hutterer@who-t.net" target="_blank">peter.hutterer@who-t.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On Mon, Jun 29, 2015 at 12:37:26PM -0700, Bill Spitzak wrote:<br>
> On Sun, Jun 28, 2015 at 8:49 PM, Peter Hutterer <<a href="mailto:peter.hutterer@who-t.net">peter.hutterer@who-t.net</a>><br>
> wrote:<br>
><br>
> ><br>
> > + if (elm->next == NULL && elm->prev == NULL)<br>
> > + return;<br>
> > +<br>
> > elm->prev->next = elm->next;<br>
> > elm->next->prev = elm->prev;<br>
> > elm->next = NULL;<br>
> ><br>
><br>
> You probably don't need to check both pointers, as the code will crash if<br>
> only one of them is NULL.<br>
<br>
yeah, that's true but obviousness in code is worth a lot. only checking next<br>
or prev will make the casual reviewer wonder why we don't check both, so<br>
it'd require a comment or generally more brain-power to review than the<br>
bleedingly obvious condition.</blockquote><div><br></div><div>I guess Bill meant "||" should be used instead of "&&"? One of the == NULL would lead to a crash...</div><div><br></div><div>Cheers,</div><div><br></div><div>Ping</div></div></div></div>