about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-02-29 01:56:37 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2020-02-29 11:36:18 +0100
commit56a3da3bd0e2f6b5963913e998c74266cf7cff7b (patch)
tree7f962fdd09085c6b5007964e623de9dcd4f1d00e /src/liballoc
parent0eb878d2aa6e3a1cb315f3f328681b26bb4bffdb (diff)
downloadrust-56a3da3bd0e2f6b5963913e998c74266cf7cff7b.tar.gz
rust-56a3da3bd0e2f6b5963913e998c74266cf7cff7b.zip
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);