-
Notifications
You must be signed in to change notification settings - Fork 13.3k
simplify boolean expressions #69569
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
simplify boolean expressions #69569
Conversation
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me with parentheses fixed
4a622c6
to
435eee0
Compare
@@ -568,7 +568,7 @@ impl<T: Ord> BinaryHeap<T> { | |||
while child < end { | |||
let right = child + 1; | |||
// compare with the greater of the two children | |||
if right < end && !(hole.get(child) > hole.get(right)) { | |||
if right < end && (hole.get(child) <= hole.get(right)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, unnecessary parentheses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the unused-parens
lint only warns on outermost parenthesis?
435eee0
to
56a3da3
Compare
@rustbot modify labels to +S-waiting-on-review |
@bors r=mark-Simulacrum rollup |
📌 Commit 56a3da3 has been approved by |
Rollup of 7 pull requests Successful merges: - #69504 (Use assert_ne in hash tests) - #69554 (Cleanup e0374) - #69568 (Clarify explanation of Vec<T> 'fn resize') - #69569 (simplify boolean expressions) - #69577 (Clean up E0375 explanation) - #69598 (rustdoc: HTML escape crate version) - #69607 (Clean up E0376 explanation) Failed merges: r? @ghost
No description provided.