diff --git a/src/server/graphics/default_configuration.cpp b/src/server/graphics/default_configuration.cpp index ed6f31ceb47..fa4b3019acd 100644 --- a/src/server/graphics/default_configuration.cpp +++ b/src/server/graphics/default_configuration.cpp @@ -97,16 +97,11 @@ auto select_platforms_from_list(std::string const& selection, std::vectorname); - if (std::find(requested_modules.begin(), requested_modules.end(), description->name) != requested_modules.end()) + if (auto const i = std::find(requested_modules.begin(), requested_modules.end(), description->name); + i != requested_modules.end()) { selected_modules.push_back(module); - requested_modules.erase( - std::remove( - requested_modules.begin(), - requested_modules.end(), - description->name), - requested_modules.end()); - break; + requested_modules.erase(i); } } catch (std::exception const&)