about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-03-01 17:23:30 +0100
committerGitHub <noreply@github.com>2020-03-01 17:23:30 +0100
commit87284d7e79da9eb106ba120600d4fb4767897869 (patch)
treee163144ce7521ab42230ab14675c6e5dac29ea76 /src/liballoc
parent55d0a8b201c0b266be48723c30e4794a0068e96e (diff)
parent56a3da3bd0e2f6b5963913e998c74266cf7cff7b (diff)
downloadrust-87284d7e79da9eb106ba120600d4fb4767897869.tar.gz
rust-87284d7e79da9eb106ba120600d4fb4767897869.zip
Rollup merge of #69569 - matthiaskrgr:nonminimal_bool, r=mark-Simulacrum
simplify boolean expressions
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/collections/binary_heap.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/liballoc/collections/binary_heap.rs b/src/liballoc/collections/binary_heap.rs
index f38fe997b73..9908a304976 100644
--- a/src/liballoc/collections/binary_heap.rs
+++ b/src/liballoc/collections/binary_heap.rs
@@ -536,7 +536,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) {
                     child = right;
                 }
                 // if we are already in order, stop.
@@ -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) {
                     child = right;
                 }
                 hole.move_to(child);