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
This commit is contained in:
commit
d19cbf8da3
@ -45,6 +45,7 @@ pub trait TotalOrd {
|
||||
pure fn cmp(&self, other: &Self) -> Ordering;
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pure fn icmp<T: Ord>(a: &T, b: &T) -> Ordering {
|
||||
if *a < *b { Less }
|
||||
else if *a > *b { Greater }
|
||||
|
Loading…
x
Reference in New Issue
Block a user