Skip to content

Commit b1c7304

Browse files
committed
Code cleanup
1 parent 702a213 commit b1c7304

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

lib/path.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,17 +228,15 @@ std::string Path::getAbsoluteFilePath(const std::string& filePath)
228228

229229
std::string Path::stripDirectoryPart(const std::string &file)
230230
{
231-
std::string fileName(file);
232231
#if defined(_WIN32)
233232
const char native = '\\';
234233
#else
235234
const char native = '/';
236235
#endif
237236

238-
std::string::size_type p = fileName.rfind(native);
239-
237+
const std::string::size_type p = file.rfind(native);
240238
if (p != std::string::npos) {
241-
fileName = fileName.substr(p + 1);
239+
return file.substr(p + 1);
242240
}
243-
return fileName;
241+
return file;
244242
}

0 commit comments

Comments
 (0)