From 5d20e18bf87e16cfdbabb24546caa06446c80ee8 Mon Sep 17 00:00:00 2001 From: Dirk Zimmermann Date: Mon, 26 Apr 2021 13:14:12 +0200 Subject: [PATCH] IOS-2794 Return own bytes, avoid copy --- pantomime-lib/Framework/Pantomime/Utils/CWThreadSafeData.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pantomime-lib/Framework/Pantomime/Utils/CWThreadSafeData.m b/pantomime-lib/Framework/Pantomime/Utils/CWThreadSafeData.m index 946a3fa..3af3744 100644 --- a/pantomime-lib/Framework/Pantomime/Utils/CWThreadSafeData.m +++ b/pantomime-lib/Framework/Pantomime/Utils/CWThreadSafeData.m @@ -84,8 +84,7 @@ NS_ASSUME_NONNULL_BEGIN __weak typeof(self) weakSelf = self; dispatch_sync(self.queue, ^{ typeof(self) strongSelf = weakSelf; - NSData *copy = strongSelf.data.copy; - copyOfBytes = copy.bytes; + copyOfBytes = strongSelf.data.bytes; }); return copyOfBytes;