Messages in this thread | | | Date | Wed, 24 Aug 2005 21:46:34 -0700 | From | Paul Jackson <> | Subject | Re: [PATCH 3/3] exterminate strtok - usr/gen_init_cpio.c |
| |
Horst wrote: > > - if ('\n' == *type) { > > + if (!*type || '\n' == *type) { > > Redundant. If *type == '\n', it is certainly != 0.
No - I don't think redundant, at least not this change in isolation. Perhaps redundant in light of subsequent code lines, as Jesper notes in his followup.
But it is confusing to read - poor and inconsistent choice of code phrasing.
If the patch had read as: - if (*type == '\n') { + if (*type == '\n' || *type == '\0') {
then it would be clearer to the reader in my view. A check for newline is changed to a check for newline or nul-byte.
(Yes - I recognize that one is not given the freedom to change the -old- lines in a patch for the sake of clarity ;).
-- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson <pj@sgi.com> 1.925.600.0401 - 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/
| |