[vlc-commits] macosx: Use for-in for table column iteration

Marvin Scholz git at videolan.org
Sat Aug 18 01:06:05 CEST 2018


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Sat Aug 18 00:45:12 2018 +0200| [691e51a4d3ba423b34e3ba6a7297a1960096db62] | committer: Marvin Scholz

macosx: Use for-in for table column iteration

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=691e51a4d3ba423b34e3ba6a7297a1960096db62
---

 modules/gui/macosx/VLCPlaylist.m | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/gui/macosx/VLCPlaylist.m b/modules/gui/macosx/VLCPlaylist.m
index 696e3ab0b2..6b31c06915 100644
--- a/modules/gui/macosx/VLCPlaylist.m
+++ b/modules/gui/macosx/VLCPlaylist.m
@@ -201,18 +201,18 @@
     [self setupPlaylistTableColumnsForMenu:[[[VLCMain sharedInstance] mainMenu] playlistTableColumnsMenu]];
 
     NSArray * columnArray = [[NSUserDefaults standardUserDefaults] arrayForKey:@"PlaylistColumnSelection"];
-    NSUInteger columnCount = [columnArray count];
-    NSString * column;
 
-    for (NSUInteger i = 0; i < columnCount; i++) {
-        column = [[columnArray objectAtIndex:i] firstObject];
-        if ([column isEqualToString:@"status"])
+    for (NSArray *column in columnArray) {
+        NSString *columnName = column[0];
+        NSNumber *columnWidth = column[1];
+
+        if ([columnName isEqualToString:@"status"])
             continue;
 
-        if(![self setPlaylistColumnTableState: NSOnState forColumn:column])
+        if(![self setPlaylistColumnTableState: NSOnState forColumn:columnName])
             continue;
 
-        [[_outlineView tableColumnWithIdentifier: column] setWidth: [[[columnArray objectAtIndex:i] objectAtIndex:1] floatValue]];
+        [[_outlineView tableColumnWithIdentifier: columnName] setWidth: [columnWidth floatValue]];
     }
 }
 



More information about the vlc-commits mailing list