Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit d4c1ae4

Browse files
committed
Correct 'PartialOrd' implementation for 'PruneCandidate'\n\nThe previous implementation used 'Ordering::reverse' incorrectly, potentially leading to incorrect element ordering. The corrected code now properly returns the result of 'self.cmp(other)', aligning with the 'PartialOrd' trait's requirements for element comparisons.
Signed-off-by: Joseph Livesey <[email protected]>
1 parent 5454770 commit d4c1ae4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

validator/src/state/state_pruning_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl Ord for PruneCandidate {
4949

5050
impl PartialOrd for PruneCandidate {
5151
fn partial_cmp(&self, other: &PruneCandidate) -> Option<Ordering> {
52-
Some(Ordering::reverse(self.0.cmp(&other.0)))
52+
Some(self.cmp(other))
5353
}
5454
}
5555

0 commit comments

Comments
 (0)