Optimize parameter passing to avoid unnecessary copying

This commit is contained in:
Pugemon
2024-06-07 04:00:38 +03:00
parent 46ca1bb04a
commit f25a425cb9
123 changed files with 578 additions and 522 deletions
+7 -7
View File
@@ -32,17 +32,17 @@ class WorldConverter : public Task {
runnable onComplete;
uint tasksDone = 0;
void convertPlayer(fs::path file) const;
void convertRegion(fs::path file) const;
void convertPlayer(const fs::path& file) const;
void convertRegion(const fs::path& file) const;
public:
WorldConverter(
fs::path folder,
const fs::path& folder,
const Content* content,
std::shared_ptr<ContentLUT> lut
);
~WorldConverter();
void convert(convert_task task) const;
void convert(const convert_task& task) const;
void convertNext();
void setOnComplete(runnable callback);
void write();
@@ -55,10 +55,10 @@ public:
uint getWorkDone() const override;
static std::shared_ptr<Task> startTask(
fs::path folder,
const fs::path& folder,
const Content* content,
std::shared_ptr<ContentLUT> lut,
runnable onDone,
const std::shared_ptr<ContentLUT>& lut,
const runnable& onDone,
bool multithreading
);
};