core: check pointer equality when comparing byte slices
This commit is contained in:
parent
3c795e08d6
commit
6af17e69ff
1 changed files with 3 additions and 0 deletions
|
@ -1831,6 +1831,9 @@ impl<A> SlicePartialEq<A> for [A]
|
|||
if self.len() != other.len() {
|
||||
return false;
|
||||
}
|
||||
if self.as_ptr() == other.as_ptr() {
|
||||
return true;
|
||||
}
|
||||
unsafe {
|
||||
let size = mem::size_of_val(self);
|
||||
memcmp(self.as_ptr() as *const u8,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue