diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-03-01 17:23:30 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-01 17:23:30 +0100 |
| commit | 87284d7e79da9eb106ba120600d4fb4767897869 (patch) | |
| tree | e163144ce7521ab42230ab14675c6e5dac29ea76 /src/liballoc | |
| parent | 55d0a8b201c0b266be48723c30e4794a0068e96e (diff) | |
| parent | 56a3da3bd0e2f6b5963913e998c74266cf7cff7b (diff) | |
| download | rust-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.rs | 4 |
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); |
