Commit fd48bd53 authored by Tobias's avatar Tobias Committed by Felix Paul Kühne
Browse files

replace occurencies of the pattern if (objects.count > 0) object = objects[0];...

replace occurencies of the pattern if (objects.count > 0) object = objects[0]; with object=objects.firstObject;
parent 9340b618
......@@ -186,8 +186,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
return mediaFile;
} else if (self.mediaList) {
NSArray *results = [MLFile fileForURL:_mediaPlayer.media.url.absoluteString];
if (results.count > 0)
return results[0];
return results.firstObject;
}
return nil;
......@@ -783,8 +782,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
[request setSortDescriptors:@[descriptor]];
NSArray *matches = [moc executeFetchRequest:request error:nil];
if (matches.count > 0)
matchedFile = matches[0];
matchedFile = matches.firstObject;
}
}
if (matchedFile.lastPosition)
......@@ -907,7 +905,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
} else {
NSArray *files = [MLFile fileForURL:[[_mediaPlayer.media url] absoluteString]];
if (files.count > 0) {
MLFile *fileFromList = files[0];
MLFile *fileFromList = files.firstObject;
fileFromList.lastPosition = @([_mediaPlayer position]);
fileFromList.lastAudioTrack = @(_mediaPlayer.currentAudioTrackIndex);
fileFromList.lastSubtitleTrack = @(_mediaPlayer.currentVideoSubTitleIndex);
......@@ -2229,8 +2227,7 @@ static inline NSArray * RemoteCommandCenterCommandsToHandle(MPRemoteCommandCente
item = self.fileFromMediaLibrary;
else if (self.mediaList) {
NSArray *matches = [MLFile fileForURL:[_mediaPlayer.media.url absoluteString]];
if (matches.count > 0)
item = matches[0];
item = matches.firstObject;
}
if (item) {
......
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