diff options
author | RSDuck <RSDuck@users.noreply.github.com> | 2023-04-28 17:05:34 +0200 |
---|---|---|
committer | RSDuck <RSDuck@users.noreply.github.com> | 2023-04-28 17:05:34 +0200 |
commit | 4b170b94d55d99e8ee9fb8803d9665fdfc2267ae (patch) | |
tree | ef29533d56be441c750ec0ce838624eedb213df5 /src/Platform.h | |
parent | 3ada5b9bc832cc612a569664de00520f00f7e558 (diff) |
pointless micro optimisations
Diffstat (limited to 'src/Platform.h')
-rw-r--r-- | src/Platform.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Platform.h b/src/Platform.h index 2227ffc..e996dea 100644 --- a/src/Platform.h +++ b/src/Platform.h @@ -108,11 +108,11 @@ bool GetConfigArray(ConfigEntry entry, void* data); // Looks in the user's data directory first, then the system's. // If on Windows or a portable UNIX build, this simply calls OpenLocalFile(). -FILE* OpenFile(std::string path, std::string mode, bool mustexist=false); -FILE* OpenLocalFile(std::string path, std::string mode); -FILE* OpenDataFile(std::string path); +FILE* OpenFile(const std::string& path, const std::string& mode, bool mustexist=false); +FILE* OpenLocalFile(const std::string& path, const std::string& mode); +FILE* OpenDataFile(const std::string& path); -inline bool FileExists(std::string name) +inline bool FileExists(const std::string& name) { FILE* f = OpenFile(name, "rb"); if (!f) return false; @@ -120,7 +120,7 @@ inline bool FileExists(std::string name) return true; } -inline bool LocalFileExists(std::string name) +inline bool LocalFileExists(const std::string& name) { FILE* f = OpenLocalFile(name, "rb"); if (!f) return false; |