Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
bed2f964f1
1 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  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]];
             }