Fix static analysis warning

This commit is contained in:
Diego Waxemberg 2015-02-01 21:09:21 -05:00 committed by Cameron Gutman
parent 11c27baaf8
commit 1313429f65
3 changed files with 4 additions and 2 deletions

View File

@ -41,7 +41,8 @@
retriever.app = app;
retriever.host = _host;
retriever.callback = _callback;
retriever.cache = useCache ? _imageCache : nil;
retriever.cache = _imageCache;
retriever.useCache = useCache;
[_opQueue addOperation:retriever];
}
}

View File

@ -17,5 +17,6 @@
@property (nonatomic) App* app;
@property (nonatomic) NSMutableDictionary* cache;
@property (nonatomic) id<AppAssetCallback> callback;
@property (nonatomic) BOOL useCache;
@end

View File

@ -19,7 +19,7 @@ static const double RETRY_DELAY = 1; // seconds
- (void) main {
UIImage* appImage = nil;
while (![self isCancelled] && appImage == nil) {
if (self.cache) {
if (self.useCache) {
@synchronized(self.cache) {
UIImage* cachedImage = [self.cache objectForKey:self.app.appId];
if (cachedImage != nil) {