File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -262,20 +262,11 @@ extension Slice: MutableCollection where Base: MutableCollection {
262
262
263
263
extension Slice : Equatable where Base. Element : Equatable {
264
264
public static func == ( lhs: Slice < Base > , rhs: Slice < Base > ) -> Bool {
265
- let lhsCount = lhs. count
266
- if lhsCount != rhs. count {
265
+ if lhs. count != rhs. count {
267
266
return false
268
267
}
269
268
// We know that lhs.count == rhs.count, compare element wise.
270
-
271
- for idx in 0 ..< lhsCount {
272
- let lidx = lhs. _base. index ( lhs. _base. startIndex, offsetBy: idx)
273
- let ridx = rhs. _base. index ( rhs. _base. startIndex, offsetBy: idx)
274
- if lhs [ lidx] != rhs [ ridx] {
275
- return false
276
- }
277
- }
278
- return true
269
+ return lhs. elementsEqual ( rhs)
279
270
}
280
271
}
281
272
You can’t perform that action at this time.
0 commit comments