mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-11 23:38:09 -05:00
refactor: use std ranges functions where applicable
This commit is contained in:
@ -25,7 +25,7 @@ void GameIW3::AddZone(Zone* zone)
|
||||
|
||||
void GameIW3::RemoveZone(Zone* zone)
|
||||
{
|
||||
const auto foundEntry = std::find(m_zones.begin(), m_zones.end(), zone);
|
||||
const auto foundEntry = std::ranges::find(m_zones, zone);
|
||||
|
||||
if (foundEntry != m_zones.end())
|
||||
m_zones.erase(foundEntry);
|
||||
|
@ -25,7 +25,7 @@ void GameIW4::AddZone(Zone* zone)
|
||||
|
||||
void GameIW4::RemoveZone(Zone* zone)
|
||||
{
|
||||
const auto foundEntry = std::find(m_zones.begin(), m_zones.end(), zone);
|
||||
const auto foundEntry = std::ranges::find(m_zones, zone);
|
||||
|
||||
if (foundEntry != m_zones.end())
|
||||
m_zones.erase(foundEntry);
|
||||
|
@ -25,7 +25,7 @@ void GameIW5::AddZone(Zone* zone)
|
||||
|
||||
void GameIW5::RemoveZone(Zone* zone)
|
||||
{
|
||||
const auto foundEntry = std::find(m_zones.begin(), m_zones.end(), zone);
|
||||
const auto foundEntry = std::ranges::find(m_zones, zone);
|
||||
|
||||
if (foundEntry != m_zones.end())
|
||||
m_zones.erase(foundEntry);
|
||||
|
@ -25,7 +25,7 @@ void GameT5::AddZone(Zone* zone)
|
||||
|
||||
void GameT5::RemoveZone(Zone* zone)
|
||||
{
|
||||
const auto foundEntry = std::find(m_zones.begin(), m_zones.end(), zone);
|
||||
const auto foundEntry = std::ranges::find(m_zones, zone);
|
||||
|
||||
if (foundEntry != m_zones.end())
|
||||
m_zones.erase(foundEntry);
|
||||
|
@ -25,7 +25,7 @@ void GameT6::AddZone(Zone* zone)
|
||||
|
||||
void GameT6::RemoveZone(Zone* zone)
|
||||
{
|
||||
const auto foundEntry = std::find(m_zones.begin(), m_zones.end(), zone);
|
||||
const auto foundEntry = std::ranges::find(m_zones, zone);
|
||||
|
||||
if (foundEntry != m_zones.end())
|
||||
m_zones.erase(foundEntry);
|
||||
|
@ -37,12 +37,11 @@ namespace state_map
|
||||
|
||||
for (auto& resultVar : entry.m_result_vars)
|
||||
{
|
||||
const auto correspondingVar = std::find_if(layout.m_var_layout.m_vars.begin(),
|
||||
layout.m_var_layout.m_vars.end(),
|
||||
[&resultVar](const StateMapLayoutVar& var)
|
||||
{
|
||||
return var.m_name == resultVar;
|
||||
});
|
||||
const auto correspondingVar = std::ranges::find_if(layout.m_var_layout.m_vars,
|
||||
[&resultVar](const StateMapLayoutVar& var)
|
||||
{
|
||||
return var.m_name == resultVar;
|
||||
});
|
||||
|
||||
// Has to have a corresponding var
|
||||
assert(correspondingVar != layout.m_var_layout.m_vars.end());
|
||||
|
Reference in New Issue
Block a user