瀏覽代碼

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]];
             }