Просмотр исходного кода

Fix “dead store” warning from the clang static analyzer.

We only use fullPath later. Subpath is only used temporarily to build the fullPath in one of the cases.
Ryan Olson лет назад: 12
Родитель
Сommit
36c88e341a
1 измененных файлов с 2 добавлено и 5 удалено
  1. 2 5
      Classes/Global State Explorers/FLEXFileBrowserTableViewController.m

+ 2 - 5
Classes/Global State Explorers/FLEXFileBrowserTableViewController.m

@@ -149,15 +149,12 @@
 
 
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
 {
 {
-    NSString *subpath;
-    NSString *fullPath;
-    
+    NSString *fullPath = nil;
     if (tableView == self.tableView) {
     if (tableView == self.tableView) {
-        subpath = [self.childPaths objectAtIndex:indexPath.row];
+        NSString *subpath = [self.childPaths objectAtIndex:indexPath.row];
         fullPath = [self.path stringByAppendingPathComponent:subpath];
         fullPath = [self.path stringByAppendingPathComponent:subpath];
     } else {
     } else {
         fullPath = [self.searchPaths objectAtIndex:indexPath.row];
         fullPath = [self.searchPaths objectAtIndex:indexPath.row];
-        subpath = [fullPath lastPathComponent];
     }
     }
     
     
     NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:fullPath error:NULL];
     NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:fullPath error:NULL];