Explorar el Código

VideoModel: Simplify thumbnail callback loop

Soomin Lee hace 6 años
padre
commit
8a29696d91
Se han modificado 1 ficheros con 3 adiciones y 5 borrados
  1. 3 5
      SharedSources/MediaLibraryModel/VideoModel.swift

+ 3 - 5
SharedSources/MediaLibraryModel/VideoModel.swift

@@ -71,11 +71,9 @@ extension VideoModel: MediaLibraryObserver {
     // MARK: - Thumbnail
 
     func medialibrary(_ medialibrary: MediaLibraryService, thumbnailReady media: VLCMLMedia) {
-        for (index, file) in files.enumerated() {
-            if file == media {
-                files[index] = media
-                break
-            }
+        for (index, file) in files.enumerated() where file == media {
+            files[index] = media
+            break
         }
         updateView?()
     }