lkml.org 
[lkml]   [2005]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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/

    \
     
     \ /
      Last update: 2005-08-25 06:49    [W:0.021 / U:0.424 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site