Merge pull request #2371 from zhongwuzw/remove-unnecessary-copy

Remove unnecessary copy
This commit is contained in:
DreamPiggy 2018-07-08 22:15:55 +08:00 committed by GitHub
commit 8dc39b17fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -50,7 +50,7 @@ static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week
config.maxCacheSize = self.maxCacheSize;
config.maxMemoryCost = self.maxMemoryCost;
config.maxMemoryCount = self.maxMemoryCount;
config.namespacePrefix = [self.namespacePrefix copyWithZone:zone];
config.namespacePrefix = self.namespacePrefix;
config.fileManager = self.fileManager; // NSFileManager does not conform to NSCopying, just pass the reference
config.memoryCacheClass = self.memoryCacheClass;
config.diskCacheClass = self.diskCacheClass;

View File

@ -67,7 +67,7 @@ typedef NS_ENUM(NSInteger, SDWebImageDownloaderExecutionOrder) {
* Set the default URL credential to be set for request operations.
* Defaults to nil.
*/
@property (nonatomic, strong, nullable) NSURLCredential *urlCredential;
@property (nonatomic, copy, nullable) NSURLCredential *urlCredential;
/**
* Set username using for HTTP Basic authentication.

View File

@ -37,9 +37,9 @@ static SDWebImageDownloaderConfig * _defaultDownloaderConfig;
config.sessionConfiguration = [self.sessionConfiguration copyWithZone:zone];
config.operationClass = self.operationClass;
config.executionOrder = self.executionOrder;
config.urlCredential = [self.urlCredential copyWithZone:zone];
config.username = [self.username copyWithZone:zone];
config.password = [self.password copyWithZone:zone];
config.urlCredential = self.urlCredential;
config.username = self.username;
config.password = self.password;
return config;
}