cxxrtl: Remove unnecessary length check

This commit is contained in:
Henri Nurmi 2023-12-10 07:42:27 +02:00 committed by Catherine
parent dbff694e3d
commit 79c0bfcb22
1 changed files with 1 additions and 1 deletions

View File

@ -636,7 +636,7 @@ std::string basename(const std::string &filepath)
const std::string dir_seps = "\\/"; const std::string dir_seps = "\\/";
#endif #endif
size_t sep_pos = filepath.find_last_of(dir_seps); size_t sep_pos = filepath.find_last_of(dir_seps);
if (sep_pos != std::string::npos && sep_pos + 1 < filepath.length()) { if (sep_pos != std::string::npos) {
return filepath.substr(sep_pos + 1); return filepath.substr(sep_pos + 1);
} }
else { else {