<p dir="ltr">It was intentional, to recycle the same reference, and not create one for each iteration</p>

<br><div class="gmail_quote">Le jeu. 11 juin 2015 21:42, Jean-Baptiste Kempf <<a href="mailto:git@videolan.org" target="_blank">git@videolan.org</a>> a écrit :<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">vlc-ports/android | branch: master | Jean-Baptiste Kempf <<a href="mailto:jb@videolan.org" target="_blank">jb@videolan.org</a>> | Thu Jun 11 21:38:54 2015 +0200| [d48bdb517e427750b928848dca4a5d86c0e1f4d6] | committer: Jean-Baptiste Kempf<br>
<br>
MediaLibrary: code simplification<br>
<br>
> <a href="http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=d48bdb517e427750b928848dca4a5d86c0e1f4d6" rel="noreferrer" target="_blank">http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=d48bdb517e427750b928848dca4a5d86c0e1f4d6</a><br>
---<br>
<br>
 vlc-android/src/org/videolan/vlc/MediaDatabase.java |    2 +-<br>
 vlc-android/src/org/videolan/vlc/MediaLibrary.java  |    9 +++------<br>
 2 files changed, 4 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/vlc-android/src/org/videolan/vlc/MediaDatabase.java b/vlc-android/src/org/videolan/vlc/MediaDatabase.java<br>
index d6fcf8b..48c3a81 100644<br>
--- a/vlc-android/src/org/videolan/vlc/MediaDatabase.java<br>
+++ b/vlc-android/src/org/videolan/vlc/MediaDatabase.java<br>
@@ -654,7 +654,7 @@ public class MediaDatabase {<br>
         Cursor cursor;<br>
         HashMap<String, MediaWrapper> medias = new HashMap<String, MediaWrapper>();<br>
         int chunk_count = 0;<br>
-        int count = 0;<br>
+        int count;<br>
<br>
         do {<br>
             count = 0;<br>
diff --git a/vlc-android/src/org/videolan/vlc/MediaLibrary.java b/vlc-android/src/org/videolan/vlc/MediaLibrary.java<br>
index 2df4fea..44784c3 100644<br>
--- a/vlc-android/src/org/videolan/vlc/MediaLibrary.java<br>
+++ b/vlc-android/src/org/videolan/vlc/MediaLibrary.java<br>
@@ -287,7 +287,6 @@ public class MediaLibrary {<br>
                 while (!directories.isEmpty()) {<br>
                     File dir = directories.pop();<br>
                     String dirPath = dir.getAbsolutePath();<br>
-                    File[] f = null;<br>
<br>
                     // Skip some system folders<br>
                     if (dirPath.startsWith("/proc/") || dirPath.startsWith("/sys/") || dirPath.startsWith("/dev/"))<br>
@@ -313,17 +312,15 @@ public class MediaLibrary {<br>
                     // Filter the extensions and the folders<br>
                     try {<br>
                         String[] files = dir.list();<br>
-                        File file;<br>
-                        if (files != null){<br>
-                            for (String fileName : files){<br>
-                                file = new File(dirPath, fileName);<br>
+                        if (files != null) {<br>
+                            for (String fileName : files) {<br>
+                                File file = new File(dirPath, fileName);<br>
                                 if (mediaFileFilter.accept(file)){<br>
                                     if (file.isFile())<br>
                                         mediaToScan.add(file);<br>
                                     else if (file.isDirectory())<br>
                                         directories.push(file);<br>
                                 }<br>
-                                file = null;<br>
                             }<br>
                         }<br>
                     } catch (Exception e){<br>
<br>
_______________________________________________<br>
Android mailing list<br>
<a href="mailto:Android@videolan.org" target="_blank">Android@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/android" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/android</a><br>
</blockquote></div>