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:
bors 2013-03-02 13:57:40 -08:00
commit d19cbf8da3

View File

@ -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 }