File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -1560,6 +1560,9 @@ impl<T: Eq> Eq for [T] {}
1560
1560
impl < T : Ord > Ord for [ T ] {
1561
1561
fn cmp ( & self , other : & [ T ] ) -> Ordering {
1562
1562
let l = cmp:: min ( self . len ( ) , other. len ( ) ) ;
1563
+
1564
+ // Slice to the loop iteration range to enable bound check
1565
+ // elimination in the compiler
1563
1566
let lhs = & self [ ..l] ;
1564
1567
let rhs = & other[ ..l] ;
1565
1568
@@ -1578,6 +1581,9 @@ impl<T: Ord> Ord for [T] {
1578
1581
impl < T : PartialOrd > PartialOrd for [ T ] {
1579
1582
fn partial_cmp ( & self , other : & [ T ] ) -> Option < Ordering > {
1580
1583
let l = cmp:: min ( self . len ( ) , other. len ( ) ) ;
1584
+
1585
+ // Slice to the loop iteration range to enable bound check
1586
+ // elimination in the compiler
1581
1587
let lhs = & self [ ..l] ;
1582
1588
let rhs = & other[ ..l] ;
1583
1589
You can’t perform that action at this time.
0 commit comments