Only call respondsToSelector once.

This commit is contained in:
Brian Dorfman
2015-10-14 16:48:01 -07:00
committed by Garrett Moon
parent 52c7463350
commit 999b5305ec

View File

@@ -184,6 +184,8 @@
options |= PINRemoteImageManagerDownloadOptionsIgnoreGIFs;
}
BOOL updateWithFullResult = [view respondsToSelector:@selector(pin_updateUIWithRemoteImageManagerResult:)];
PINRemoteImageManagerImageCompletion internalProgress = nil;
if ([self updateWithProgressOnView:view] && processorKey.length <= 0 && processor == nil) {
internalProgress = ^(PINRemoteImageManagerResult *result)
@@ -195,7 +197,7 @@
return;
}
if (result.image) {
if ([view respondsToSelector:@selector(pin_updateUIWithRemoteImageManagerResult:)]) {
if (updateWithFullResult) {
[view pin_updateUIWithRemoteImageManagerResult:result];
}
else {
@@ -230,7 +232,7 @@
return;
}
if ([view respondsToSelector:@selector(pin_updateUIWithRemoteImageManagerResult:)]) {
if (updateWithFullResult) {
[view pin_updateUIWithRemoteImageManagerResult:result];
}
else {