We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 702a213 commit b1c7304Copy full SHA for b1c7304
1 file changed
lib/path.cpp
@@ -228,17 +228,15 @@ std::string Path::getAbsoluteFilePath(const std::string& filePath)
228
229
std::string Path::stripDirectoryPart(const std::string &file)
230
{
231
- std::string fileName(file);
232
#if defined(_WIN32)
233
const char native = '\\';
234
#else
235
const char native = '/';
236
#endif
237
238
- std::string::size_type p = fileName.rfind(native);
239
-
+ const std::string::size_type p = file.rfind(native);
240
if (p != std::string::npos) {
241
- fileName = fileName.substr(p + 1);
+ return file.substr(p + 1);
242
}
243
- return fileName;
+ return file;
244
0 commit comments