From cdb6a577da0162df6692237abe24d8b6331209c9 Mon Sep 17 00:00:00 2001 From: Alan Griffiths Date: Tue, 24 Oct 2023 11:02:03 +0100 Subject: [PATCH 1/2] Don't stop after matching the first platform --- src/server/graphics/default_configuration.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/server/graphics/default_configuration.cpp b/src/server/graphics/default_configuration.cpp index ed6f31ceb47..09aa97fc5c3 100644 --- a/src/server/graphics/default_configuration.cpp +++ b/src/server/graphics/default_configuration.cpp @@ -106,7 +106,6 @@ auto select_platforms_from_list(std::string const& selection, std::vectorname), requested_modules.end()); - break; } } catch (std::exception const&) From c539fb425df35996d4a9263eb1850fcd82bfd497 Mon Sep 17 00:00:00 2001 From: Alan Griffiths Date: Tue, 24 Oct 2023 11:04:32 +0100 Subject: [PATCH 2/2] Simplify --- src/server/graphics/default_configuration.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/server/graphics/default_configuration.cpp b/src/server/graphics/default_configuration.cpp index 09aa97fc5c3..fa4b3019acd 100644 --- a/src/server/graphics/default_configuration.cpp +++ b/src/server/graphics/default_configuration.cpp @@ -97,15 +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()); + requested_modules.erase(i); } } catch (std::exception const&)