[vlc-commits] macosx: initWithCapacity is a no-op in current ObjC implementations

Felix Paul Kühne git at videolan.org
Mon Jul 13 14:55:49 CEST 2015


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Jul 13 14:20:31 2015 +0200| [56bc52036d11a3e333a6e4f0380a9036478a8fb1] | committer: Felix Paul Kühne

macosx: initWithCapacity is a no-op in current ObjC implementations

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

 modules/gui/macosx/playlistinfo.m |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/gui/macosx/playlistinfo.m b/modules/gui/macosx/playlistinfo.m
index 8274ba5..473c6dd 100644
--- a/modules/gui/macosx/playlistinfo.m
+++ b/modules/gui/macosx/playlistinfo.m
@@ -467,9 +467,9 @@ error:
         return nil;
 
     if (o_children == NULL) {
+        o_children = [[NSMutableArray alloc] init];
         if (i_object_id == -1) {
             vlc_mutex_lock(&p_item->lock);
-            o_children = [[NSMutableArray alloc] initWithCapacity: p_item->i_categories];
             for (int i = 0 ; i < p_item->i_categories ; i++) {
                 NSString * name = [NSString stringWithUTF8String:p_item->pp_categories[i]->psz_name];
                 VLCInfoTreeItem * item = [[VLCInfoTreeItem alloc] initWithName:name value:@"" ID:i parent:self];
@@ -481,7 +481,6 @@ error:
         else if (o_parent->i_object_id == -1) {
             vlc_mutex_lock(&p_item->lock);
             info_category_t * cat = p_item->pp_categories[i_object_id];
-            o_children = [[NSMutableArray alloc] initWithCapacity: cat->i_infos];
             for (int i = 0 ; i < cat->i_infos ; i++) {
                 NSString * name = [NSString stringWithUTF8String:cat->pp_infos[i]->psz_name];
                 NSString * value = [NSString stringWithUTF8String:cat->pp_infos[i]->psz_value ? : ""];



More information about the vlc-commits mailing list