Skip to content

Commit 0337cc1

Browse files
committed
Use more optimal Ord implementation for integers
1 parent bea0372 commit 0337cc1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libcore/cmp.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1012,9 +1012,9 @@ mod impls {
10121012
impl Ord for $t {
10131013
#[inline]
10141014
fn cmp(&self, other: &$t) -> Ordering {
1015-
if *self == *other { Equal }
1016-
else if *self < *other { Less }
1017-
else { Greater }
1015+
if *self < *other { Less }
1016+
else if *self > *other { Greater }
1017+
else { Equal }
10181018
}
10191019
}
10201020
)*)

0 commit comments

Comments
 (0)