refactor, wallet: Avoid variable shadowing #27087

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:230212-shadow changing 1 files +1 −3
  1. hebasto commented at 4:55 pm on February 12, 2023: member
    This PR is a follow up of #26661 that introduced a local variable shadowing which I’ve noticed while reviewing #25665.
  2. DrahtBot commented at 4:55 pm on February 12, 2023: contributor

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK stickies-v, furszy

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

    Conflicts

    No conflicts as of last run.

  3. DrahtBot added the label Refactoring on Feb 12, 2023
  4. hebasto commented at 4:58 pm on February 12, 2023: member
    cc @furszy
  5. kbakdev approved
  6. refactor: wallet, avoid shadowing, remove unneeded res variable. 3fb01a94aa
  7. furszy commented at 0:33 am on February 13, 2023: member
    Could remove the top variable instead of renaming the internal one: https://github.com/furszy/bitcoin-core/commit/3fb01a94aa29dec9c546c0d0e9e54a513b3dee43.
  8. hebasto force-pushed on Feb 13, 2023
  9. hebasto renamed this:
    refactor: Rename variable to avoid shadowing
    refactor, wallet: Avoid variable shadowing
    on Feb 13, 2023
  10. hebasto commented at 9:44 am on February 13, 2023: member

    Could remove the top variable instead of renaming the internal one: furszy@3fb01a9.

    Thanks! Done.

  11. stickies-v approved
  12. stickies-v commented at 12:05 pm on February 13, 2023: contributor
    ACK 3fb01a94aa29dec9c546c0d0e9e54a513b3dee43
  13. furszy approved
  14. furszy commented at 12:40 pm on February 13, 2023: member
    ACK 3fb01a9
  15. fanquake commented at 1:36 pm on February 13, 2023: member
    There are currently multiple instances of -Wshadow warnings emmited when compiling the codebase. Is there some reason this one specifically needs fixing? Otherwise this just introduces a pointless merge conflict to a number of very recently-rebased PRs.
  16. hebasto commented at 2:38 pm on February 13, 2023: member

    There are currently multiple instances of -Wshadow warnings emmited when compiling the codebase.

    It was not about compiler warning, rather about code readability.

    Is there some reason this one specifically needs fixing?

    Probably subjective, but there was some extra mental burden while reviewing other PRs which touch this code.

    Otherwise this just introduces a pointless merge conflict to a number of very recently-rebased PRs.

    I hoped that just renaming (the first version of this PR) will not introduce any conflicts.

  17. hebasto closed this on Feb 13, 2023

  18. bitcoin locked this on Feb 13, 2024

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: 2024-07-05 22:12 UTC

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