Improved const correctness, there are no functional changes.

This commit is contained in:
orbitcowboy 2017-05-12 16:20:47 +02:00
parent 0090cd9ce5
commit b9bac79a8c
1 changed files with 7 additions and 7 deletions

View File

@ -46,11 +46,11 @@ static bool caseInsensitiveFilesystem()
std::string Path::toNativeSeparators(std::string path)
{
#if defined(_WIN32)
char separ = '/';
char native = '\\';
const char separ = '/';
const char native = '\\';
#else
char separ = '\\';
char native = '/';
const char separ = '\\';
const char native = '/';
#endif
std::replace(path.begin(), path.end(), separ, native);
return path;
@ -58,8 +58,8 @@ std::string Path::toNativeSeparators(std::string path)
std::string Path::fromNativeSeparators(std::string path)
{
char nonnative = '\\';
char newsepar = '/';
const char nonnative = '\\';
const char newsepar = '/';
std::replace(path.begin(), path.end(), nonnative, newsepar);
return path;
}
@ -130,7 +130,7 @@ std::string Path::simplifyPath(std::string originalPath)
std::string Path::getPathFromFilename(const std::string &filename)
{
std::size_t pos = filename.find_last_of("\\/");
const std::size_t pos = filename.find_last_of("\\/");
if (pos != std::string::npos)
return filename.substr(0, 1 + pos);