Change Objc BOOL true/false into correct YES/NO

This commit is contained in:
DreamPiggy 2023-02-07 02:32:11 +08:00
parent 7cec27bab9
commit f2d7610181
4 changed files with 8 additions and 8 deletions

View File

@ -249,9 +249,9 @@
} else if (self.playbackMode == SDAnimatedImagePlaybackModeBounce ||
self.playbackMode == SDAnimatedImagePlaybackModeReversedBounce) {
if (currentFrameIndex == 0) {
self.shouldReverse = false;
self.shouldReverse = NO;
} else if (currentFrameIndex == totalFrameCount - 1) {
self.shouldReverse = true;
self.shouldReverse = YES;
}
nextFrameIndex = self.shouldReverse ? (currentFrameIndex - 1) : (currentFrameIndex + 1);
nextFrameIndex %= totalFrameCount;

View File

@ -518,7 +518,7 @@ didReceiveResponse:(NSURLResponse *)response
if (dataOperation) {
@synchronized (dataOperation) {
// Mark the downloader operation `isCompleted = YES`, no longer re-use this operation when new request comes in
SDWebImageDownloaderOperationSetCompleted(dataOperation, true);
SDWebImageDownloaderOperationSetCompleted(dataOperation, YES);
}
}
if ([dataOperation respondsToSelector:@selector(URLSession:task:didCompleteWithError:)]) {

View File

@ -680,7 +680,7 @@ static BOOL _isCalled;
player.playbackMode = SDAnimatedImagePlaybackModeBounce;
__block NSInteger i = 0;
__block BOOL flag = false;
__block BOOL flag = NO;
__block NSUInteger cnt = 0;
__weak typeof(imageView) wimageView = imageView;
[player setAnimationFrameHandler:^(NSUInteger index, UIImage * _Nonnull frame) {
@ -689,10 +689,10 @@ static BOOL _isCalled;
if (index >= player.totalFrameCount - 1) {
cnt++;
flag = true;
flag = YES;
} else if (cnt != 0 && index == 0) {
cnt++;
flag = false;
flag = NO;
}
if (!flag) {
@ -745,7 +745,7 @@ static BOOL _isCalled;
flag = false;
} else if (index == 0) {
cnt++;
flag = true;
flag = YES;
}
if (flag) {

View File

@ -233,7 +233,7 @@ static NSString *kTestImageKeyPNG = @"TestImageKey.png";
[SDImageCache.sharedImageCache removeImageFromDiskForKey:key];
__block BOOL callced = NO;
SDImageCacheToken *token = [SDImageCache.sharedImageCache queryCacheOperationForKey:key done:^(UIImage * _Nullable image, NSData * _Nullable data, SDImageCacheType cacheType) {
callced = true;
callced = YES;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0), dispatch_get_main_queue(), ^{
[expectation fulfill]; // callback once fulfill once
});