lkml.org 
[lkml]   [2003]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch] 2.5.70-bk11 zlib cleanup #3 Z_NULL

On Fri, 6 Jun 2003, Jörn Engel wrote:
>
> How do you feel about "if (z->state->blocks != NULL)"? Remove the
> pointless !=NULL or keep it?

I don't mind it, but it doesn't buy much.

It's actually in some other cases where I think there is a readability
issue, ie in more complex conditionals I personally prefer the simpler
cersion, ie I much prefer something like

if (ptr && ptr->ops && ptr->ops->shutdown)
ptr->ops->shutdown(ptr, xxxx);

over the pointless NULL-masturbation in something like

if (ptr != NULL && ptr->ops != NULL && ptr->ops->shutdown != NULL)
ptr->ops->shutdown(ptr, xxxx)

which I just is much less readable than the simple version.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.043 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site