From d838d8e3adedb425d604aee89e3b7107fcfa70b4 Mon Sep 17 00:00:00 2001 From: DoomDuck Date: Mon, 29 Jan 2024 12:23:16 +0100 Subject: image::Bytes::PartialEq: use core::ptr::eq to speed up comparison --- core/src/image.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 } } -- cgit From d6aea096468edc618b4b5972dd39daded55a9eb0 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 7 Feb 2024 20:33:15 +0100 Subject: Update `CHANGELOG` --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 518124e7..c24255b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Assert dimensions of quads are normal in `iced_tiny_skia`. [#2082](https://github.com/iced-rs/iced/pull/2082) - Remove `position` from `overlay::Element`. [#2226](https://github.com/iced-rs/iced/pull/2226) - Add a capacity limit to the `GlyphCache` in `iced_tiny_skia`. [#2210](https://github.com/iced-rs/iced/pull/2210) +- Use pointer equality to speed up `PartialEq` implementation of `image::Bytes`. [#2220](https://github.com/iced-rs/iced/pull/2220) ### Fixed - Clipping of `TextInput` selection. [#2199](https://github.com/iced-rs/iced/pull/2199) @@ -114,6 +115,7 @@ Many thanks to... - @Davidster - @Decodetalkers - @derezzedex +- @DoomDuck - @dtzxporter - @fogarecious - @GyulyVGC -- cgit