core: check pointer equality when comparing byte slices
This commit is contained in:
parent
3c795e08d6
commit
6af17e69ff
@ -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…
x
Reference in New Issue
Block a user