[Android] AndroidMediaLibrary: Avoid copying some parameters

Hugo Beauzée-Luyssen git at videolan.org
Wed Dec 21 14:30:45 CET 2016


vlc-android | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Dec 21 14:29:54 2016 +0100| [f5095bdf49265109fb9456df0006ae69e2114781] | committer: Hugo Beauzée-Luyssen

AndroidMediaLibrary: Avoid copying some parameters

> https://code.videolan.org/videolan/vlc-android/commit/f5095bdf49265109fb9456df0006ae69e2114781
---

 medialibrary/jni/AndroidMediaLibrary.cpp | 4 ++--
 medialibrary/jni/AndroidMediaLibrary.h   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/medialibrary/jni/AndroidMediaLibrary.cpp b/medialibrary/jni/AndroidMediaLibrary.cpp
index c0229bb..5063c3e 100644
--- a/medialibrary/jni/AndroidMediaLibrary.cpp
+++ b/medialibrary/jni/AndroidMediaLibrary.cpp
@@ -62,7 +62,7 @@ AndroidMediaLibrary::initML(const std::string& dbPath, const std::string& thumbs
 }
 
 void
-AndroidMediaLibrary::addDevice(std::string uuid, std::string path, bool removable)
+AndroidMediaLibrary::addDevice(const std::string& uuid, const std::string& path, bool removable)
 {
     p_lister->addDevice(uuid, path, removable);
     p_DeviceListerCb->onDevicePlugged(uuid, path);
@@ -75,7 +75,7 @@ AndroidMediaLibrary::devices()
 }
 
 bool
-AndroidMediaLibrary::removeDevice(std::string uuid)
+AndroidMediaLibrary::removeDevice(const std::string& uuid)
 {
     bool removed = p_lister->removeDevice(uuid);
     if (removed)
diff --git a/medialibrary/jni/AndroidMediaLibrary.h b/medialibrary/jni/AndroidMediaLibrary.h
index 77429a5..6b3d3c2 100644
--- a/medialibrary/jni/AndroidMediaLibrary.h
+++ b/medialibrary/jni/AndroidMediaLibrary.h
@@ -30,9 +30,9 @@ public:
     ~AndroidMediaLibrary();
 
     void initML(const std::string& dbPath, const std::string& thumbsPath);
-    void addDevice(std::string uuid, std::string path, bool removable);
+    void addDevice(const std::string& uuid, const std::string& path, bool removable);
     std::vector<std::tuple<std::string, std::string, bool>> devices();
-    bool removeDevice(std::string uuid);
+    bool removeDevice(const std::string& uuid);
     void banFolder(const std::string& path);
     void discover(const std::string&);
     void removeEntryPoint(const std::string& entryPoint);



More information about the Android mailing list