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
1 changed files with 1 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue