소스 검색

VLCRemoteBrowsingTVCell: Add .intValue highlighted by static analyzer

Xcode identified what it believes are four cases of integer comparison
without the necessary .intValue method for converting the NSNumber to an
integer for the comparison to succeed.

Each case does appear to be correctly identified, so this adds four
instances of .intValue matching similar cases elsewhere in the codebase.
Richard Soderberg 6 년 전
부모
커밋
bed2f964f1
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      SharedSources/Clouds/VLCRemoteBrowsingTVCell+CloudStorage.m

+ 4 - 4
SharedSources/Clouds/VLCRemoteBrowsingTVCell+CloudStorage.m

@@ -59,7 +59,7 @@
             self.thumbnailImage = [UIImage imageNamed:@"folder"];
         } else {
             self.isDirectory = NO;
-            self.subtitle = (boxFile.size > 0) ? [NSByteCountFormatter stringFromByteCount:[boxFile.size longLongValue] countStyle:NSByteCountFormatterCountStyleFile]: @"";
+            self.subtitle = (boxFile.size.intValue > 0) ? [NSByteCountFormatter stringFromByteCount:[boxFile.size longLongValue] countStyle:NSByteCountFormatterCountStyleFile]: @"";
             self.thumbnailImage = [UIImage imageNamed:@"blank"];
         }
         self.title = boxFile.name;
@@ -85,13 +85,13 @@
                 }
             }
 
-            if (oneDriveFile.size > 0) {
+            if (oneDriveFile.size.intValue > 0) {
                 [subtitle appendString:[NSByteCountFormatter stringFromByteCount:[oneDriveFile.size longLongValue] countStyle:NSByteCountFormatterCountStyleFile]];
-                if (oneDriveFile.duration > 0) {
+                if (oneDriveFile.duration.intValue > 0) {
                     VLCTime *time = [VLCTime timeWithNumber:oneDriveFile.duration];
                     [subtitle appendFormat:@" — %@", [time verboseStringValue]];
                 }
-            } else if (oneDriveFile.duration > 0) {
+            } else if (oneDriveFile.duration.intValue > 0) {
                 VLCTime *time = [VLCTime timeWithNumber:oneDriveFile.duration];
                 [subtitle appendString:[time verboseStringValue]];
             }