refactor: Deleted unreachable code in httpserver.cpp #26666

pull JoaoAJMatos wants to merge 2 commits into bitcoin:master from JoaoAJMatos:master changing 1 files +3 −11
  1. JoaoAJMatos commented at 5:44 PM on December 8, 2022: contributor

    Some of the code in httpserver.cpp was unreachable, and didn't follow the developer notes. Continuation of #26570

  2. DrahtBot commented at 5:44 PM on December 8, 2022: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Stale ACK stickies-v

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. DrahtBot added the label Refactoring on Dec 8, 2022
  4. stickies-v approved
  5. stickies-v commented at 11:44 AM on December 9, 2022: contributor

    cc @hebasto @w0xlt

    Thank you for picking this up again @JoaoAJMatos - could you please update the PR description to reflect that this is a continuation of #26570 so people can see the discussion that happened there?

    ACK c695dd91e - I checked that all the suggestions made in #26570 are implemented here. It removes unreachable code and improves adherence to developer notes, without behaviour change.

    nit: I would suggest updating the current commit messages to prefix them with "refactor: ". See e.g. this guide on how you can do that if you're unsure.

    If I may offer some further suggestions to your contribution workflow:

    • it would have been more productive to not close the original PR but just clean up the existing branch and force push it instead of opening a new PR, so the entire discussion is all in one place. If you're not familiar with git rebasing and force pushing, I'd warmly recommend doing some reading/tutorials on that as it's an essential skill (and not too long to learn) for contributing to projects like Bitcoin Core. Also best to practice these operations on a private repo (e.g. your clone https://github.com/JoaoAJMatos/bitcoin) first instead of this PR to minimize unnecessary updates that require review time. See e.g. this guide as well: https://obc.256k1.dev/#_development_workflow
    • I would work on a feature branch instead of working on master (git checkout -b httpserver-delete-unreachable-code for example) so you can easily switch between different PRs and also have a view of the current master
  6. refactor: Deleted unreachable code in httpserver.cpp
    Removed all break statements from both RequestMethodString and GetRequestMethod functions as they were unreachable
    7fd3b9491b
  7. refactor: Refactored RequestMethodString function to follow developer notes
    Removed the default case in the switch statement in order to comply with the Developer Notes
    8f5c560e11
  8. JoaoAJMatos force-pushed on Dec 9, 2022
  9. JoaoAJMatos requested review from stickies-v on Dec 10, 2022
  10. stickies-v approved
  11. stickies-v commented at 11:55 AM on December 10, 2022: contributor

    re-ACK 8f5c560

  12. maflcko merged this on Dec 10, 2022
  13. maflcko closed this on Dec 10, 2022

  14. sidhujag referenced this in commit de862d954e on Dec 10, 2022
  15. bitcoin locked this on Dec 10, 2023

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-22 06:13 UTC

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