File tree Expand file tree Collapse file tree 1 file changed +0
-27
lines changed Expand file tree Collapse file tree 1 file changed +0
-27
lines changed Original file line number Diff line number Diff line change 75
75
}
76
76
}
77
77
78
- // Use an equal-pointer optimization when types are `Eq`
79
- // We can't make `A` and `B` the same type because `min_specialization` won't
80
- // allow it.
81
- impl < A , B > SlicePartialEq < B > for [ A ]
82
- where
83
- A : MarkerEq < B > ,
84
- {
85
- default fn equal ( & self , other : & [ B ] ) -> bool {
86
- if self . len ( ) != other. len ( ) {
87
- return false ;
88
- }
89
-
90
- // While performance would suffer if `guaranteed_eq` just returned `false`
91
- // for all arguments, correctness and return value of this function are not affected.
92
- if self . as_ptr ( ) . guaranteed_eq ( other. as_ptr ( ) as * const A ) {
93
- return true ;
94
- }
95
-
96
- self . iter ( ) . zip ( other. iter ( ) ) . all ( |( x, y) | x == y)
97
- }
98
- }
99
-
100
78
// Use memcmp for bytewise equality when the types allow
101
79
impl < A , B > SlicePartialEq < B > for [ A ]
102
80
where
@@ -107,11 +85,6 @@ where
107
85
return false ;
108
86
}
109
87
110
- // While performance would suffer if `guaranteed_eq` just returned `false`
111
- // for all arguments, correctness and return value of this function are not affected.
112
- if self . as_ptr ( ) . guaranteed_eq ( other. as_ptr ( ) as * const A ) {
113
- return true ;
114
- }
115
88
// SAFETY: `self` and `other` are references and are thus guaranteed to be valid.
116
89
// The two slices have been checked to have the same size above.
117
90
unsafe {
You can’t perform that action at this time.
0 commit comments