Skip to content

Commit

Permalink
Fixed a typo for prefetchQueue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Limwin94 committed Aug 1, 2023
1 parent bd961dd commit adc54d0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Sources/Networking/ImagePrefetcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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() }
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit adc54d0

Please sign in to comment.