[vlc-commits] macosx: minor code cleanup

Felix Paul Kühne git at videolan.org
Wed Sep 11 17:54:47 CEST 2013


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Sep 11 17:54:27 2013 +0200| [ae7b7ece58550de04680fa0ff680a9da19cfb1ed] | committer: Felix Paul Kühne

macosx: minor code cleanup

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

 modules/gui/macosx/bookmarks.m |   21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/modules/gui/macosx/bookmarks.m b/modules/gui/macosx/bookmarks.m
index cf5f999..e2564d3 100644
--- a/modules/gui/macosx/bookmarks.m
+++ b/modules/gui/macosx/bookmarks.m
@@ -367,17 +367,18 @@ clear:
 
     if (!p_input)
         return 0;
-    else if (input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks) != VLC_SUCCESS) {
-        vlc_object_release(p_input);
+
+    int returnValue = input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks);
+    vlc_object_release(p_input);
+
+    if (returnValue != VLC_SUCCESS)
         return 0;
-    } else {
-        vlc_object_release(p_input);
-        // Clear the bookmark list
-        for (int i = 0; i < i_bookmarks; i++)
-            vlc_seekpoint_Delete(pp_bookmarks[i]);
-        free(pp_bookmarks);
-        return i_bookmarks;
-    }
+
+    for (int i = 0; i < i_bookmarks; i++)
+        vlc_seekpoint_Delete(pp_bookmarks[i]);
+    free(pp_bookmarks);
+
+    return i_bookmarks;
 }
 
 - (id)tableView:(NSTableView *)theDataTable objectValueForTableColumn: (NSTableColumn *)theTableColumn row: (NSInteger)row



More information about the vlc-commits mailing list