Remove unnecessary and RVO-detrimental moves

This commit is contained in:
Jack Andersen 2016-10-02 18:37:20 -10:00
parent 38de2ec4a1
commit d106299a11
3 changed files with 5 additions and 5 deletions

View File

@ -363,7 +363,7 @@ public:
virtual ~DiscBuilderBase() {} virtual ~DiscBuilderBase() {}
DiscBuilderBase(const SystemChar* outPath, int64_t discCapacity, DiscBuilderBase(const SystemChar* outPath, int64_t discCapacity,
std::function<void(size_t idx, const SystemString&, size_t)> progressCB) std::function<void(size_t idx, const SystemString&, size_t)> progressCB)
: m_outPath(outPath), m_fileIO(std::move(NewFileIO(outPath, discCapacity))), : m_outPath(outPath), m_fileIO(NewFileIO(outPath, discCapacity)),
m_discCapacity(discCapacity), m_progressCB(progressCB) {} m_discCapacity(discCapacity), m_progressCB(progressCB) {}
IFileIO& getFileIO() {return *m_fileIO;} IFileIO& getFileIO() {return *m_fileIO;}

View File

@ -177,7 +177,7 @@ DirectoryEnumerator::DirectoryEnumerator(const SystemChar* path, Mode mode,
else else
continue; continue;
m_entries.push_back(std::move(Entry(std::move(fp), d->d_name, sz, isDir))); m_entries.push_back(Entry(std::move(fp), d->d_name, sz, isDir));
} }
break; break;
case Mode::DirsThenFilesSorted: case Mode::DirsThenFilesSorted:

View File

@ -11,7 +11,7 @@ class DiscIOISO : public IDiscIO
std::unique_ptr<IFileIO> m_fio; std::unique_ptr<IFileIO> m_fio;
public: public:
DiscIOISO(const SystemString& fpin) DiscIOISO(const SystemString& fpin)
: m_fio(std::move(NewFileIO(fpin))) {} : m_fio(NewFileIO(fpin)) {}
class ReadStream : public IReadStream class ReadStream : public IReadStream
{ {
@ -30,7 +30,7 @@ public:
std::unique_ptr<IReadStream> beginReadStream(uint64_t offset) const std::unique_ptr<IReadStream> beginReadStream(uint64_t offset) const
{ {
return std::unique_ptr<IReadStream>(new ReadStream(std::move(m_fio->beginReadStream(offset)))); return std::unique_ptr<IReadStream>(new ReadStream(m_fio->beginReadStream(offset)));
} }
class WriteStream : public IWriteStream class WriteStream : public IWriteStream
@ -48,7 +48,7 @@ public:
std::unique_ptr<IWriteStream> beginWriteStream(uint64_t offset) const std::unique_ptr<IWriteStream> beginWriteStream(uint64_t offset) const
{ {
return std::unique_ptr<IWriteStream>(new WriteStream(std::move(m_fio->beginWriteStream(offset)))); return std::unique_ptr<IWriteStream>(new WriteStream(m_fio->beginWriteStream(offset)));
} }
}; };