inline the implementation of TotalOrd for integers

This commit is contained in:
Daniel Micay 2013-03-02 16:30:42 -05:00
parent afdd0b868a
commit 3550233d37

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 }