Commit db20e29a authored by Max Kellermann's avatar Max Kellermann

Directory: pass std::string&& to constructor

parent 5f5c95cc
...@@ -41,10 +41,10 @@ extern "C" { ...@@ -41,10 +41,10 @@ extern "C" {
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
Directory::Directory(const char *_path_utf8, Directory *_parent) Directory::Directory(std::string &&_path_utf8, Directory *_parent)
:parent(_parent), :parent(_parent),
mtime(0), have_stat(false), mtime(0), have_stat(false),
path(_path_utf8) path(std::move(_path_utf8))
{ {
INIT_LIST_HEAD(&children); INIT_LIST_HEAD(&children);
INIT_LIST_HEAD(&songs); INIT_LIST_HEAD(&songs);
......
...@@ -85,7 +85,7 @@ struct Directory { ...@@ -85,7 +85,7 @@ struct Directory {
std::string path; std::string path;
public: public:
Directory(const char *_path_utf8, Directory *_parent); Directory(std::string &&_path_utf8, Directory *_parent);
~Directory(); ~Directory();
/** /**
...@@ -93,7 +93,7 @@ public: ...@@ -93,7 +93,7 @@ public:
*/ */
gcc_malloc gcc_malloc
static Directory *NewRoot() { static Directory *NewRoot() {
return new Directory("", nullptr); return new Directory(std::string(), nullptr);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment