[Android] Playlist getter optimization
Geoffrey Métais
git at videolan.org
Tue Mar 10 07:19:29 CET 2020
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Mar 9 16:31:00 2020 +0100| [45346284d7ee25695f4a81ca25f10fd0277dcbf9] | committer: Nicolas Pomepuy
Playlist getter optimization
> https://code.videolan.org/videolan/vlc-android/commit/45346284d7ee25695f4a81ca25f10fd0277dcbf9
---
.../vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.kt
index 1b63a9859..ff3f730b9 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.kt
@@ -187,4 +187,4 @@ class SavePlaylistDialog : VLCBottomSheetDialogFragment(), View.OnClickListener,
}
}
-fun Medialibrary.getPlaylistByName(name: String): Playlist? = playlists.filter { it.title == name }.getOrNull(0)
+fun Medialibrary.getPlaylistByName(name: String)= playlists.firstOrNull { it.title == name }
More information about the Android
mailing list