aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-23 22:02:02 +0100
committerMax Kellermann <max@duempel.org>2014-02-23 22:02:02 +0100
commitdb20e29af6a3fc31f783c4584739ca1592beaabb (patch)
treea901e5f86163e82bceee1307d720480128ca1845 /src
parent5f5c95cc6811a013c4739dcfce7486302c5ff3c6 (diff)
downloadmpd-db20e29af6a3fc31f783c4584739ca1592beaabb.tar.gz
mpd-db20e29af6a3fc31f783c4584739ca1592beaabb.tar.xz
mpd-db20e29af6a3fc31f783c4584739ca1592beaabb.zip
Directory: pass std::string&& to constructor
Diffstat (limited to 'src')
-rw-r--r--src/db/Directory.cxx4
-rw-r--r--src/db/Directory.hxx4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/db/Directory.cxx b/src/db/Directory.cxx
index 9c7c83314..04bdfa88f 100644
--- a/src/db/Directory.cxx
+++ b/src/db/Directory.cxx
@@ -41,10 +41,10 @@ extern "C" {
#include <string.h>
#include <stdlib.h>
-Directory::Directory(const char *_path_utf8, Directory *_parent)
+Directory::Directory(std::string &&_path_utf8, Directory *_parent)
:parent(_parent),
mtime(0), have_stat(false),
- path(_path_utf8)
+ path(std::move(_path_utf8))
{
INIT_LIST_HEAD(&children);
INIT_LIST_HEAD(&songs);
diff --git a/src/db/Directory.hxx b/src/db/Directory.hxx
index ebca95935..391ca2db4 100644
--- a/src/db/Directory.hxx
+++ b/src/db/Directory.hxx
@@ -85,7 +85,7 @@ struct Directory {
std::string path;
public:
- Directory(const char *_path_utf8, Directory *_parent);
+ Directory(std::string &&_path_utf8, Directory *_parent);
~Directory();
/**
@@ -93,7 +93,7 @@ public:
*/
gcc_malloc
static Directory *NewRoot() {
- return new Directory("", nullptr);
+ return new Directory(std::string(), nullptr);
}
/**