image::Bytes::PartialEq: use core::ptr::eq to speed up comparison
This commit is contained in:
parent
80a29a277e
commit
d838d8e3ad
1 changed files with 3 additions and 1 deletions
|
|
@ -112,7 +112,9 @@ impl std::hash::Hash for Bytes {
|
|||
|
||||
impl PartialEq for Bytes {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.as_ref() == other.as_ref()
|
||||
let a = self.as_ref();
|
||||
let b = other.as_ref();
|
||||
core::ptr::eq(a, b) || a == b
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue