diff options
author | Nathan Woods <npwoods@mess.org> | 2017-04-05 20:02:55 -0400 |
---|---|---|
committer | Vas Crabb <cuavas@users.noreply.github.com> | 2017-04-06 11:19:55 +1000 |
commit | 694a7812155927f89df046b585836ce872929e72 (patch) | |
tree | aa6a915640f9faed90594622b1b9a4bff5713c3d | |
parent | ab8b83e9ed98c13234cb8911048953cea8976cd7 (diff) |
Changed a lookup within the softlist code to use std::find_if()
-rw-r--r-- | src/emu/softlist.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/emu/softlist.cpp b/src/emu/softlist.cpp index 5182881274a..1d2fcf17100 100644 --- a/src/emu/softlist.cpp +++ b/src/emu/softlist.cpp @@ -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; } |