Commit 52e0eeb8 authored by Carola Nitz's avatar Carola Nitz

VLCNetworkServer*: fix order in medialists

parent 44f32f2a
...@@ -67,9 +67,8 @@ ...@@ -67,9 +67,8 @@
{ {
VLCMediaList *mediaList = [[VLCMediaList alloc] init]; VLCMediaList *mediaList = [[VLCMediaList alloc] init];
@synchronized(_items) { @synchronized(_items) {
NSUInteger count = _items.count; for (id<VLCNetworkServerBrowserItem> browseritem in _items) {
for (NSInteger i = count - 1; i >= 0; i--) { VLCMedia *media = [browseritem media];
VLCMedia *media = [_items[i] media];
if (media) if (media)
[mediaList addMedia:media]; [mediaList addMedia:media];
} }
......
...@@ -125,10 +125,9 @@ ...@@ -125,10 +125,9 @@
{ {
NSMutableArray *mediaArray; NSMutableArray *mediaArray;
@synchronized(_items) { @synchronized(_items) {
NSUInteger count = _items.count; mediaArray = [NSMutableArray new];
mediaArray = [NSMutableArray arrayWithCapacity:count]; for (id<VLCNetworkServerBrowserItem> browseritem in _items) {
for (NSInteger i = count - 1; i >= 0; i--) { VLCMedia *media = [browseritem media];
VLCMedia *media = [_items[i] media];
if (media) if (media)
[mediaArray addObject:media]; [mediaArray addObject:media];
} }
......
...@@ -358,9 +358,8 @@ ...@@ -358,9 +358,8 @@
{ {
VLCMediaList *mediaList = [[VLCMediaList alloc] init]; VLCMediaList *mediaList = [[VLCMediaList alloc] init];
@synchronized(_items) { @synchronized(_items) {
NSUInteger count = _items.count; for (id<VLCNetworkServerBrowserItem> browseritem in _items) {
for (NSInteger i = count - 1; i >= 0; i--) { VLCMedia *media = [browseritem media];
VLCMedia *media = [_items[i] media];
if (media) if (media)
[mediaList addMedia:media]; [mediaList addMedia:media];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment