• brucedawson's avatar
    Rewriting patch logic without the comma operator. · 944c28c5
    brucedawson authored
    When running /analyze on all of Chrome there were three warnings about
    using the comma operator in a tested expression. One was a genuine bug
    and the other two were in UncompressAndPatchChromeArchive. Rewriting
    to use nested if statements resolves these warnings (getting the count
    to zero) and makes the code clearer.
    
    Resolving the warning is not crucial, but it makes it easier to make a
    zero-tolerance policy for that warning and thus avoid future bugs.
    Plus, it makes the setup code easier to read.
    
    The warnings are:
    
    src\chrome\installer\setup\setup_main.cc(174) : warning C6319: Use of the comma-operator in a tested expression causes the left argument to be ignored when it has no side-effects.
    src\chrome\installer\setup\setup_main.cc(176) : warning C6319: Use of the comma-operator in a tested expression causes the left argument to be ignored when it has no side-effects.
    
    The bug that was found through this warning, which could eventually
    have been very serious, was fixed here:
    https://codereview.chromium.org/678193003
    
    BUG=427616
    
    Review URL: https://codereview.chromium.org/893703004
    
    Cr-Commit-Position: refs/heads/master@{#314389}
    944c28c5
setup_main.cc 74.5 KB