Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dead-code patch by renu555 #1

Merged
merged 3 commits into from Jul 6, 2014

Commits on Jul 6, 2014

  1. Fixing unreachable condition.

      if (!isMultiLine) at line 563 suggests that isMultiline is 0 when if takes true branch. So the condition && at line 571 will always be false.
    Also at line 568 !isMultiline in loop conditional check suggests that it depends only on one condition i.e. index <size because !isMultiline is always true. 
    Hence , it seems logical mistake at line 571 of using && instead of ||
    renu555 authored and cdunn2001 committed Jul 6, 2014
    Copy the full SHA
    17c244e View commit details
    Browse the repository at this point in the history
  2. Fix dead code scenario.

    Changes explained
    renu555 authored and cdunn2001 committed Jul 6, 2014
    Copy the full SHA
    66b7738 View commit details
    Browse the repository at this point in the history
  3. Always true condition.

        for (int index = 0; index < size && !isMultiLine; ++index) 
    In addition to dead code, in the above if condition checking to !isMultiLine is of no use as it will be always true and hence "for" depends only on condition [index < size.]
    The mentioned test case works fine in this case also.
    renu555 authored and cdunn2001 committed Jul 6, 2014
    Copy the full SHA
    41b7939 View commit details
    Browse the repository at this point in the history