Remove redundant 'break'. #13272

issue fbthrift opened this issue on May 18, 2018
  1. fbthrift commented at 6:16 AM on May 18, 2018: none

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    version: 0.16.0 source: /src/httpserver.cpp line 196、199、202、205: dead code

    switch (m) {
    case HTTPRequest::GET:
        return "GET";
        break;
    case HTTPRequest::POST:
        return "POST";
        break;
    case HTTPRequest::HEAD:
        return "HEAD";
        break;
    case HTTPRequest::PUT:
        return "PUT";
        break;

    <!--- What behavior did you expect? -->

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    <!-- Any extra information that might be useful in the debugging process. -->

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

  2. MarcoFalke closed this on May 18, 2018

  3. fbthrift commented at 5:38 AM on May 21, 2018: none

    switch (m) { case HTTPRequest::GET: return "GET"; break; //dead code

  4. ken2812221 commented at 5:53 AM on May 21, 2018: contributor

    It's a good C++ programming style and will be optimized by the compiler.

  5. MarcoFalke commented at 4:24 PM on May 21, 2018: member

    As pointed out by @ken2812221 this does not affect the resulting binary and is just a stylistic issue, not a bug.

  6. fbthrift commented at 7:49 AM on May 23, 2018: none

    yes, i agree this is a code quality issue. Do you think it need to be modified?

  7. sipa commented at 7:51 AM on May 23, 2018: member

    I think it would be a regression to make this change.

  8. fanquake locked this on Jun 1, 2018

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-29 03:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me