Merge pull request #13093 from mitaclaw/ranges-modernization-4-projection

Ranges Algorithms Modernization - Projection
This commit is contained in:
JMC47
2025-03-23 15:56:13 -04:00
committed by GitHub
36 changed files with 128 additions and 176 deletions

View File

@ -11,6 +11,8 @@
#include <utility>
#include <vector>
#include "Common/Projection.h"
namespace Config
{
using Layers = std::map<LayerType, std::shared_ptr<Layer>>;
@ -168,8 +170,7 @@ const std::string& GetSystemName(System system)
std::optional<System> GetSystemFromName(const std::string& name)
{
const auto system = std::find_if(system_to_name.begin(), system_to_name.end(),
[&name](const auto& entry) { return entry.second == name; });
const auto system = std::ranges::find(system_to_name, name, Common::Projection::Value{});
if (system != system_to_name.end())
return system->first;