maint(compression): pass args by reference
Co-authored-by: William Roy <wroy@proton.me>
This commit is contained in:
parent
cf3a4e18e6
commit
beb90226fe
@ -35,7 +35,7 @@ int main(const int argc, const char** argv)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
unsafe_main(argc > 1 ? static_cast<uint16_t>(atoi(argv[1])) : 20810);
|
unsafe_main(argc > 1 ? static_cast<uint16_t>(std::strtol(argv[1], nullptr, 10)) : 20810);
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
|
@ -134,9 +134,9 @@ namespace utils::compression
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void archive::add(std::string filename, std::string data)
|
void archive::add(const std::string& filename, const std::string& data)
|
||||||
{
|
{
|
||||||
this->files_[std::move(filename)] = std::move(data);
|
this->files_[filename] = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool archive::write(const std::string& filename, const std::string& comment)
|
bool archive::write(const std::string& filename, const std::string& comment)
|
||||||
|
@ -18,7 +18,7 @@ namespace utils::compression
|
|||||||
class archive
|
class archive
|
||||||
{
|
{
|
||||||
public:
|
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 = {});
|
bool write(const std::string& filename, const std::string& comment = {});
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user