Code cleanup
This commit is contained in:
parent
702a213175
commit
b1c730405f
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue