core: use iterators for slice equality comparison
This commit is contained in:
parent
30b27f350c
commit
d482589f29
1 changed files with 2 additions and 14 deletions
|
|
@ -5294,13 +5294,7 @@ impl<A, B> SlicePartialEq<B> for [A]
|
|||
return false;
|
||||
}
|
||||
|
||||
for i in 0..self.len() {
|
||||
if !self[i].eq(&other[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
true
|
||||
self.iter().zip(other.iter()).all(|(x, y)| x == y)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5317,13 +5311,7 @@ impl<A> SlicePartialEq<A> for [A]
|
|||
return true;
|
||||
}
|
||||
|
||||
for i in 0..self.len() {
|
||||
if !self[i].eq(&other[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
true
|
||||
self.iter().zip(other.iter()).all(|(x, y)| x == y)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue