summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-02-07 20:39:39 +0100
committerLibravatar GitHub <noreply@github.com>2024-02-07 20:39:39 +0100
commit5630febf963ffcdd9eb1e0e8581a65a08d501467 (patch)
treeaef084d40768ef369f2419b88dc4ad3ac6d305a3 /core/src
parent80081f0f1c00d9dc94d3ed24dd37ab5285cff0db (diff)
parentd6aea096468edc618b4b5972dd39daded55a9eb0 (diff)
downloadiced-5630febf963ffcdd9eb1e0e8581a65a08d501467.tar.gz
iced-5630febf963ffcdd9eb1e0e8581a65a08d501467.tar.bz2
iced-5630febf963ffcdd9eb1e0e8581a65a08d501467.zip
Merge pull request #2220 from DoomDuck/faster_image_bytes_handle
Use `core::ptr::eq` to speed up `PartialEq` on `image::Bytes`
Diffstat (limited to 'core/src')
-rw-r--r--core/src/image.rs4
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
}
}