refactor: Use c++ 'char_traits::length' instead of c 'strlen'
This commit is contained in:
1 parent
66e1b94d1b
commit
c0a7f1b3fe
1 file changed
+1
-1
@@ -57,7 +57,7 @@ inline std::string change_file_ext(
|
||||
bool require_expected_ext = false) {
|
||||
std::size_t exp_ext_pos = path.find_last_of(expected_ext);
|
||||
if (exp_ext_pos < path.size())
|
||||
return path.substr(0, exp_ext_pos + 1 - std::strlen(expected_ext)) +
|
||||
return path.substr(0, exp_ext_pos + 1 - std::char_traits<char>::length(expected_ext)) +
|
||||
new_ext;
|
||||
else if (require_expected_ext)
|
||||
return {};
|
||||
|
||||
Reference in new issue
Block a user