From adc54d07df5a70b79107b690654f455b0d5062fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9E=84=EC=8A=B9=ED=98=81?= Date: Tue, 1 Aug 2023 17:17:17 +0900 Subject: [PATCH] Fixed a typo for prefetchQueue. --- Sources/Networking/ImagePrefetcher.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/Networking/ImagePrefetcher.swift b/Sources/Networking/ImagePrefetcher.swift index 3fce14c47..e8011ed4a 100644 --- a/Sources/Networking/ImagePrefetcher.swift +++ b/Sources/Networking/ImagePrefetcher.swift @@ -99,7 +99,7 @@ public class ImagePrefetcher: CustomStringConvertible { // A manager used for prefetching. We will use the helper methods in manager. private let manager: KingfisherManager - private let pretchQueue = DispatchQueue(label: "com.onevcat.Kingfisher.ImagePrefetcher.pretchQueue") + private let prefetchQueue = DispatchQueue(label: "com.onevcat.Kingfisher.ImagePrefetcher.prefetchQueue") private static let requestingQueue = DispatchQueue(label: "com.onevcat.Kingfisher.ImagePrefetcher.requestingQueue") private var finished: Bool { @@ -263,7 +263,7 @@ public class ImagePrefetcher: CustomStringConvertible { // We want all callbacks from our prefetch queue, so we should ignore the callback queue in options. // Add our own callback dispatch queue to make sure all internal callbacks are // coming back in our expected queue. - options.callbackQueue = .dispatch(pretchQueue) + options.callbackQueue = .dispatch(prefetchQueue) optionsInfo = options let cache = optionsInfo.targetCache ?? .default @@ -275,7 +275,7 @@ public class ImagePrefetcher: CustomStringConvertible { /// of assets that are required for later use in an app. This code will not try and update any UI /// with the results of the process. public func start() { - pretchQueue.async { + prefetchQueue.async { guard !self.stopped else { assertionFailure("You can not restart the same prefetcher. Try to create a new prefetcher.") self.handleComplete() @@ -305,7 +305,7 @@ public class ImagePrefetcher: CustomStringConvertible { /// Stops current downloading progress, and cancel any future prefetching activity that might be occuring. public func stop() { - pretchQueue.async { + prefetchQueue.async { if self.finished { return } self.stopped = true self.tasks.values.forEach { $0.cancel() } @@ -410,7 +410,7 @@ public class ImagePrefetcher: CustomStringConvertible { private func reportCompletionOrStartNext() { if let resource = self.pendingSources.popFirst() { // Loose call stack for huge ammount of sources. - pretchQueue.async { self.startPrefetching(resource) } + prefetchQueue.async { self.startPrefetching(resource) } } else { guard allFinished else { return } self.handleComplete()