mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-19 08:41:39 +00:00
Simplify std::remove
with std::erase
`std::erase` is a replacement for the remove-erase idiom. Changes to `OpenModeToAndroid` inadvertently revealed that the prior implementation had UB (potentially deleting the end iterator). This is now fixed.
This commit is contained in:
parent
4fde0f2868
commit
be0b13da97
2 changed files with 2 additions and 4 deletions
|
@ -62,7 +62,7 @@ bool IsPathAndroidContent(std::string_view uri)
|
|||
std::string OpenModeToAndroid(std::string mode)
|
||||
{
|
||||
// The 'b' specifier is not supported by Android. Since we're on POSIX, it's fine to just skip it.
|
||||
mode.erase(std::remove(mode.begin(), mode.end(), 'b'));
|
||||
std::erase(mode, 'b');
|
||||
|
||||
if (mode == "r")
|
||||
return "r";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue