From 59b663f68e69f27a87b45de48cb63264b8194605 Mon Sep 17 00:00:00 2001 From: Brandon Williams <135203+mbrandonw@users.noreply.github.com> Date: Mon, 27 Nov 2023 14:00:38 -0500 Subject: [PATCH] =?UTF-8?q?Improve=20the=20speed=20of=20comparing=20memory?= =?UTF-8?q?=20buffers=20by=20using=20a=20workaround=20t=E2=80=A6=20(#812)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Improve the speed of comparing memory buffers by using a workaround to a missed compiler optimization Co-authored-by: Eric Jensen * Update NSImage.swift * Update UIImage.swift * fix --------- Co-authored-by: Eric Jensen Co-authored-by: Stephen Celis --- Sources/SnapshotTesting/Snapshotting/NSImage.swift | 10 ++++++++-- Sources/SnapshotTesting/Snapshotting/UIImage.swift | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Sources/SnapshotTesting/Snapshotting/NSImage.swift b/Sources/SnapshotTesting/Snapshotting/NSImage.swift index 0f1d5b481..be4fd7cd4 100644 --- a/Sources/SnapshotTesting/Snapshotting/NSImage.swift +++ b/Sources/SnapshotTesting/Snapshotting/NSImage.swift @@ -118,8 +118,14 @@ let newRep = NSBitmapImageRep(cgImage: newerCgImage).bitmapData! let byteCountThreshold = Int((1 - precision) * Float(byteCount)) var differentByteCount = 0 - for offset in 0..