From 71cd0fc20eb9a1037ae56ced8143f8eb2d3d96a9 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Tue, 16 Apr 2024 22:08:26 -0700 Subject: [PATCH] Fix concurrency warnings in Core module. --- Core/Sources/Core/RSImage.swift | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/Core/Sources/Core/RSImage.swift b/Core/Sources/Core/RSImage.swift index 7e312031b..ea768ce58 100644 --- a/Core/Sources/Core/RSImage.swift +++ b/Core/Sources/Core/RSImage.swift @@ -93,24 +93,7 @@ public extension RSImage { static func image(with data: Data) async -> RSImage? { - let task = Task.detached { () -> RSImage? in - RSImage(data: data) - } - return await task.value - } - - /// Asynchronously initializes an image from data. - /// - /// - Parameters: - /// - data: The data object containing the image data. - /// - imageResultBlock: The closure to call when the image has been initialized. - static func image(with data: Data, imageResultBlock: @escaping ImageResultBlock) { - DispatchQueue.global().async { - let image = RSImage(data: data) - DispatchQueue.main.async { - imageResultBlock(image) - } - } + RSImage(data: data) } /// Create a scaled image from image data.