diff --git a/include/textfile.hpp b/include/textfile.hpp index bb6740de..67c3af91 100755 --- a/include/textfile.hpp +++ b/include/textfile.hpp @@ -14,8 +14,8 @@ class TextFile { public: TextFile(); - void Load(std::string filename); - bool TryLoad(std::string filename); + void Load(const std::string &filename); + bool TryLoad(const std::string &filename); size_t LineCount() const; const std::string &Line(size_t id) const; diff --git a/src/textfile.cpp b/src/textfile.cpp index 5baf4da4..d03c1529 100755 --- a/src/textfile.cpp +++ b/src/textfile.cpp @@ -13,7 +13,7 @@ TextFile::TextFile() : lines{} { } -bool TextFile::TryLoad(std::string name) +bool TextFile::TryLoad(const std::string &name) { if (name.length() == 0) return false; @@ -33,9 +33,9 @@ bool TextFile::TryLoad(std::string name) return true; } -void TextFile::Load(std::string name) +void TextFile::Load(const std::string &name) { - std::string filename = format(DATA_PATH "/", name); + std::string filename = DATA_PATH "/" + name; std::ifstream file(filename, std::ios::in); if (file.bad()) {