Directory: pass std::string&& to constructor
This commit is contained in:
parent
5f5c95cc68
commit
db20e29af6
@ -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 {
|
|||||||
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:
|
|||||||
*/
|
*/
|
||||||
gcc_malloc
|
gcc_malloc
|
||||||
static Directory *NewRoot() {
|
static Directory *NewRoot() {
|
||||||
return new Directory("", nullptr);
|
return new Directory(std::string(), nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user