Code cleanup

This commit is contained in:
Daniel Marjamäki 2017-10-06 22:45:37 +02:00
parent 702a213175
commit b1c730405f
1 changed files with 3 additions and 5 deletions

View File

@ -228,17 +228,15 @@ std::string Path::getAbsoluteFilePath(const std::string& filePath)
std::string Path::stripDirectoryPart(const std::string &file) std::string Path::stripDirectoryPart(const std::string &file)
{ {
std::string fileName(file);
#if defined(_WIN32) #if defined(_WIN32)
const char native = '\\'; const char native = '\\';
#else #else
const char native = '/'; const char native = '/';
#endif #endif
std::string::size_type p = fileName.rfind(native); const std::string::size_type p = file.rfind(native);
if (p != std::string::npos) { if (p != std::string::npos) {
fileName = fileName.substr(p + 1); return file.substr(p + 1);
} }
return fileName; return file;
} }