Skip to content

Commit d19cbf8

Browse files
committed
auto merge of #5206 : thestinger/rust/cmp, r=brson
minor little performance issue - the vector and string implementations of TotalOrd turn out badly without explicitly inlining this
2 parents afdd0b8 + 3550233 commit d19cbf8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libcore/cmp.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pub trait TotalOrd {
4545
pure fn cmp(&self, other: &Self) -> Ordering;
4646
}
4747

48+
#[inline(always)]
4849
pure fn icmp<T: Ord>(a: &T, b: &T) -> Ordering {
4950
if *a < *b { Less }
5051
else if *a > *b { Greater }

0 commit comments

Comments
 (0)