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 9a54d88c8c
-
darosior force-pushed on Mar 31, 2023
-
stickies-v approved
-
stickies-v commented at 4:11 pm on March 31, 2023: contributorACK 9a54d88c8cb0c5d529f388c2ce53008e1ff126dd
-
fanquake merged this on Apr 2, 2023
-
fanquake closed this on Apr 2, 2023
-
sidhujag referenced this in commit cf03fcd943 on Apr 2, 2023
-
darosior deleted the branch on Apr 2, 2023
-
bitcoin locked this on Apr 1, 2024
Labels
Descriptors