[Android] Use correct iterator

Geoffrey Métais git at videolan.org
Thu May 7 16:29:25 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu May  7 14:49:16 2015 +0200| [bef4bb0962dc6b96268f5f1a0e049f8aeffa7ccd] | committer: Geoffrey Métais

Use correct iterator

CID #1297092

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

 vlc-android/src/org/videolan/vlc/MediaLibrary.java |   39 +++++++++++---------
 1 file changed, 21 insertions(+), 18 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/MediaLibrary.java b/vlc-android/src/org/videolan/vlc/MediaLibrary.java
index 1d16ee9..e20d374 100644
--- a/vlc-android/src/org/videolan/vlc/MediaLibrary.java
+++ b/vlc-android/src/org/videolan/vlc/MediaLibrary.java
@@ -20,6 +20,23 @@
 
 package org.videolan.vlc;
 
+import android.content.Context;
+import android.os.Environment;
+import android.os.Handler;
+import android.os.Message;
+import android.text.TextUtils;
+import android.util.Log;
+
+import org.videolan.libvlc.LibVLC;
+import org.videolan.libvlc.Media;
+import org.videolan.libvlc.util.Extensions;
+import org.videolan.vlc.gui.audio.AudioBrowserListAdapter;
+import org.videolan.vlc.interfaces.IBrowser;
+import org.videolan.vlc.util.AndroidDevices;
+import org.videolan.vlc.util.Util;
+import org.videolan.vlc.util.VLCInstance;
+import org.videolan.vlc.util.WeakHandler;
+
 import java.io.File;
 import java.io.FileFilter;
 import java.io.IOException;
@@ -30,27 +47,11 @@ import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Locale;
+import java.util.Map;
 import java.util.Stack;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
-import org.videolan.libvlc.LibVLC;
-import org.videolan.libvlc.Media;
-import org.videolan.libvlc.util.Extensions;
-import org.videolan.vlc.gui.audio.AudioBrowserListAdapter;
-import org.videolan.vlc.interfaces.IBrowser;
-import org.videolan.vlc.util.AndroidDevices;
-import org.videolan.vlc.util.Util;
-import org.videolan.vlc.util.VLCInstance;
-import org.videolan.vlc.util.WeakHandler;
-
-import android.content.Context;
-import android.os.Environment;
-import android.os.Handler;
-import android.os.Message;
-import android.text.TextUtils;
-import android.util.Log;
-
 public class MediaLibrary {
     public final static String TAG = "VLC/MediaLibrary";
 
@@ -336,8 +337,10 @@ public class MediaLibrary {
 
                 //Remove ignored files
                 HashSet<String> mediasToRemove = new HashSet<String>();
+                String path;
                 outloop:
-                for (String path : existingMedias.keySet()){
+                for (Map.Entry<String, MediaWrapper> entry : existingMedias.entrySet()){
+                    path = entry.getKey();
                     for (String dirPath : dirsToIgnore) {
                         if (path.startsWith(dirPath)) {
                             mediasToRemove.add(path);



More information about the Android mailing list