[Android] [PATCH 1/4] Do not check existence here, could be redundant

Geoffrey Métais geoffrey.metais at gmail.com
Thu Apr 30 14:27:19 CEST 2015


---
 vlc-android/src/org/videolan/vlc/MediaDatabase.java | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/MediaDatabase.java b/vlc-android/src/org/videolan/vlc/MediaDatabase.java
index 2a9e2b6..0deabdb 100644
--- a/vlc-android/src/org/videolan/vlc/MediaDatabase.java
+++ b/vlc-android/src/org/videolan/vlc/MediaDatabase.java
@@ -895,11 +895,9 @@ public class MediaDatabase {
      * @param path
      */
     public synchronized void addDir(String path) {
-        if (!mediaDirExists(path)) {
-            ContentValues values = new ContentValues();
-            values.put(DIR_ROW_PATH, path);
-            mDb.insert(DIR_TABLE_NAME, null, values);
-        }
+        ContentValues values = new ContentValues();
+        values.put(DIR_ROW_PATH, path);
+        mDb.insert(DIR_TABLE_NAME, null, values);
     }
 
     /**
-- 
2.1.4



More information about the Android mailing list