mirror of
https://github.com/holub/mame
synced 2025-10-05 08:41:31 +03:00
Changed a lookup within the softlist code to use std::find_if()
This commit is contained in:
parent
ab8b83e9ed
commit
694a781215
@ -75,11 +75,14 @@ software_part::software_part(software_info &info, std::string &&name, std::strin
|
||||
const char *software_part::feature(const std::string &feature_name) const
|
||||
{
|
||||
// scan the feature list for an entry matching feature_name and return the value
|
||||
for (const feature_list_item &feature : m_featurelist)
|
||||
if (feature.name() == feature_name)
|
||||
return feature.value().c_str();
|
||||
return nullptr;
|
||||
auto iter = std::find_if(
|
||||
m_featurelist.begin(),
|
||||
m_featurelist.end(),
|
||||
[&feature_name](const feature_list_item &feature) { return feature.name() == feature_name; });
|
||||
|
||||
return iter != m_featurelist.end()
|
||||
? iter->value().c_str()
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user