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] {}
15601560impl < T : Ord > Ord for [ T ] {
15611561 fn cmp ( & self , other : & [ T ] ) -> Ordering {
15621562 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
15631566 let lhs = & self [ ..l] ;
15641567 let rhs = & other[ ..l] ;
15651568
@@ -1578,6 +1581,9 @@ impl<T: Ord> Ord for [T] {
15781581impl < T : PartialOrd > PartialOrd for [ T ] {
15791582 fn partial_cmp ( & self , other : & [ T ] ) -> Option < Ordering > {
15801583 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
15811587 let lhs = & self [ ..l] ;
15821588 let rhs = & other[ ..l] ;
15831589
You can’t perform that action at this time.
0 commit comments