partition_filesystem, vfs_real: Use std::move in ReplaceFileWithSubdirectory() where applicable
Avoids unnecessary atomic increment and decrement operations.
This commit is contained in:
parent
2b91386e15
commit
d36e327ba6
|
@ -109,7 +109,7 @@ bool PartitionFilesystem::ReplaceFileWithSubdirectory(VirtualFile file, VirtualD
|
||||||
pfs_files[offset] = pfs_files.back();
|
pfs_files[offset] = pfs_files.back();
|
||||||
pfs_files.pop_back();
|
pfs_files.pop_back();
|
||||||
|
|
||||||
pfs_dirs.emplace_back(dir);
|
pfs_dirs.emplace_back(std::move(dir));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "common/common_paths.h"
|
#include "common/common_paths.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
|
@ -173,7 +174,7 @@ bool RealVfsDirectory::ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir
|
||||||
files[offset] = files.back();
|
files[offset] = files.back();
|
||||||
files.pop_back();
|
files.pop_back();
|
||||||
|
|
||||||
subdirectories.emplace_back(dir);
|
subdirectories.emplace_back(std::move(dir));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue