Skip to content

Commit

Permalink
Use remove_if correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Apr 5, 2024
1 parent 5bead8d commit ad7da71
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1516,10 +1516,12 @@ void Config::RemoveRecent(const std::string &file) {
std::lock_guard<std::mutex> guard(private_->recentIsosLock);

const auto &filename = File::ResolvePath(file);
std::remove_if(recentIsos.begin(), recentIsos.end(), [filename](const auto &str) {
auto iter = std::remove_if(recentIsos.begin(), recentIsos.end(), [filename](const auto &str) {
const auto &recent = File::ResolvePath(str);
return filename == recent;
});
// remove_if is weird.
recentIsos.erase(iter, recentIsos.end());
}

void Config::CleanRecent() {
Expand Down

0 comments on commit ad7da71

Please sign in to comment.