maint(compression): pass args by reference

This commit is contained in:
Diavolo 2023-05-26 19:29:21 +02:00
parent 266e902411
commit 3b959ff397
2 changed files with 3 additions and 3 deletions

View File

@ -108,8 +108,8 @@ bool add_file(zipFile& zip_file, const std::string& filename,
}
} // namespace
void archive::add(std::string filename, std::string data) {
this->files_[std::move(filename)] = std::move(data);
void archive::add(const std::string& filename, const std::string& data) {
this->files_[filename] = data;
}
bool archive::write(const std::string& filename, const std::string& comment) {

View File

@ -11,7 +11,7 @@ std::string decompress(const std::string& data);
namespace zip {
class archive {
public:
void add(std::string filename, std::string data);
void add(const std::string& filename, const std::string& data);
bool write(const std::string& filename, const std::string& comment = {});
private: