diff options
author | 2024-01-29 12:23:16 +0100 | |
---|---|---|
committer | 2024-02-07 20:32:15 +0100 | |
commit | d838d8e3adedb425d604aee89e3b7107fcfa70b4 (patch) | |
tree | 961733fe3b140e109da39448e7a9f46804f1239d /core/src/image.rs | |
parent | 80a29a277e2f15c0711efc37dc6c86c2ef98879e (diff) | |
download | iced-d838d8e3adedb425d604aee89e3b7107fcfa70b4.tar.gz iced-d838d8e3adedb425d604aee89e3b7107fcfa70b4.tar.bz2 iced-d838d8e3adedb425d604aee89e3b7107fcfa70b4.zip |
image::Bytes::PartialEq: use core::ptr::eq to speed up comparison
Diffstat (limited to 'core/src/image.rs')
-rw-r--r-- | core/src/image.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/src/image.rs b/core/src/image.rs index e9675316..e5fdcd83 100644 --- a/core/src/image.rs +++ b/core/src/image.rs @@ -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 } } |