miniscript: explicit cast instead of comparing integers of different signs #27382
pull darosior wants to merge 1 commits into bitcoin:master from darosior:miniscript_comp_int_size changing 1 files +1 −1-
darosior commented at 1:42 pm on March 31, 2023: memberFixes #27381
-
DrahtBot commented at 1:42 pm on March 31, 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 If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
-
DrahtBot added the label Descriptors on Mar 31, 2023
-
in src/script/miniscript.h:1197 in 5d6e691cde outdated
1193@@ -1194,7 +1194,7 @@ struct Node { 1194 case Fragment::OR_I: 1195 return subs[0] || subs[1]; 1196 case Fragment::THRESH: 1197- return std::count(subs.begin(), subs.end(), true) >= node.k; 1198+ return unsigned(std::count(subs.begin(), subs.end(), true)) >= node.k;
stickies-v commented at 3:13 pm on March 31, 2023:Maybe best to avoid C-style casts?
0 return static_cast<uint32_t>(std::count(subs.begin(), subs.end(), true)) >= node.k;
darosior commented at 3:37 pm on March 31, 2023:Sure, done. (I don’t think it matters in this precise case though.)miniscript: explicit cast instead of comparing integers of different signs 9a54d88c8cdarosior force-pushed on Mar 31, 2023stickies-v approvedstickies-v commented at 4:11 pm on March 31, 2023: contributorACK 9a54d88c8cb0c5d529f388c2ce53008e1ff126ddfanquake merged this on Apr 2, 2023fanquake closed this on Apr 2, 2023
sidhujag referenced this in commit cf03fcd943 on Apr 2, 2023darosior deleted the branch on Apr 2, 2023bitcoin locked this on Apr 1, 2024Labels
Descriptors
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-12-21 15:12 UTC
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 15:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me