From 56a3da3bd0e2f6b5963913e998c74266cf7cff7b Mon Sep 17 00:00:00 2001 From: Matthias Krüger Date: Sat, 29 Feb 2020 01:56:37 +0100 Subject: simplify boolean expressions --- src/liballoc/collections/binary_heap.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/liballoc') 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 BinaryHeap { 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 BinaryHeap { 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); -- cgit 1.4.1-3-g733a5