Remove unused variable assignment #31497
pull yancyribbens wants to merge 1 commits into bitcoin:master from yancyribbens:remove-unused-var-assighnment changing 1 files +0 −1-
yancyribbens commented at 3:01 am on December 14, 2024: contributorThe variable is conditionally assigned toward the end of the loop and not used after. It’s then set back to its default value at the beginning of the loop.
-
Remove unused variable assignment
The variable is conditionally assigned toward the end of the loop and not used after. It's then set back to its default value at the beginning of the loop.
-
DrahtBot commented at 3:02 am on December 14, 2024: contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Code Coverage & Benchmarks
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31497.
Reviews
See the guideline for information on the review process.
Type Reviewers ACK theuni, hodlinator If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
-
theuni commented at 5:18 pm on December 16, 2024: memberLooks like the same is true for
should_shift
below. Paging @murchandamus just to make sure those vars are scoped as-intended and that this isn’t pointing out a bug. -
yancyribbens commented at 5:23 pm on December 16, 2024: contributorI don’t think the same is true for
should_shift
. It’s last assigned on L505 but that’s inside a while loop that depends on the condition ofshould_shift
. -
theuni commented at 5:31 pm on December 16, 2024: member
Ah, of course you’re right. I didn’t notice that loop condition.
Sorry for the noise.
-
yancyribbens commented at 7:17 pm on December 17, 2024: contributor
Sorry for the noise.
No problem. It’s pretty plain to see that this variable isn’t used and can be removed. Not sure if it’s worth bugging Murch to look at.
-
theuni commented at 1:49 pm on December 18, 2024: member
Sorry for the noise.
No problem. It’s pretty plain to see that this variable isn’t used and can be removed. Not sure if it’s worth bugging Murch to look at.
Yes, agreed. I pinged because I thought there was more than 1 instance, which might have pointed out a broken refactor at some point. But yeah, it’s pretty clearly just an unnecessary assignment.
utACK b9766c9977e58a9ebc358d9879576376e76a72b1
-
hodlinator approved
-
hodlinator commented at 11:20 am on December 19, 2024: contributor
crACK b9766c9977e58a9ebc358d9879576376e76a72b1
This dead store was a leftover from the introduction of CoinGrinder in 6cc9a46cd0f4ed80d4523bbef1508142e0c80d27 / #27877.
Checked that there are no shenanigans with the variable being captured into a lambda further up which is then called further down.
-
maflcko requested review from murchandamus on Dec 19, 2024
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-12-21 12:12 UTC
More mirrored repositories can be found on mirror.b10c.me