Skip to content

Commit

Permalink
12139: refactor to compute export path only once instead of once per …
Browse files Browse the repository at this point in the history
…file
  • Loading branch information
fbastos1 committed Oct 28, 2020
1 parent f627e27 commit 2104b60
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/Core/DiscIO/DiscExtractor.cpp
Expand Up @@ -130,15 +130,15 @@ void ExportDirectory(const Volume& volume, const Partition& partition, const Fil
const std::string& export_folder,
const std::function<bool(const std::string& path)>& update_progress)
{
File::CreateFullPath(export_folder +
(directory.IsDirectory() ? "/" + directory.GetName() + "/" : "/"));
std::string export_root =
export_folder + (directory.IsDirectory() ? "/" + directory.GetName() + "/" : "/");
File::CreateFullPath(export_root);

for (const FileInfo& file_info : directory)
{
const std::string name = file_info.GetName() + (file_info.IsDirectory() ? "/" : "");
const std::string path = filesystem_path + name;
const std::string export_path =
export_folder + (directory.IsDirectory() ? "/" + directory.GetName() + "/" : "/") + name;
const std::string export_path = export_root + name;

if (update_progress(path))
return;
Expand Down

0 comments on commit 2104b60

Please sign in to comment.