Skip to content
Permalink
Browse files

Improve readability of CButtonMapXml::IsValid()

  • Loading branch information...
garbear committed Oct 11, 2016
1 parent d1d343e commit 1cf4ae4924a103d1cbf6dac5dc9f59663422fa08
Showing with 6 additions and 7 deletions.
  1. +6 −7 src/storage/xml/ButtonMapXml.cpp
@@ -313,13 +313,12 @@ bool CButtonMapXml::Serialize(const FeatureVector& features, TiXmlElement* pElem

bool CButtonMapXml::IsValid(const ADDON::JoystickFeature& feature)
{
auto itValid = std::find_if(feature.Primitives().begin(), feature.Primitives().end(),
[](const ADDON::DriverPrimitive& primitive)
{
return primitive.Type() != JOYSTICK_DRIVER_PRIMITIVE_TYPE_UNKNOWN;
});

return itValid != feature.Primitives().end();
for (auto primitive : feature.Primitives())
{
if (primitive.Type() != JOYSTICK_DRIVER_PRIMITIVE_TYPE_UNKNOWN)
return true;
}
return false;
}

bool CButtonMapXml::SerializePrimitiveTag(TiXmlElement* pElement, const ADDON::DriverPrimitive& primitive, const char* tagName)

0 comments on commit 1cf4ae4

Please sign in to comment.
You can’t perform that action at this time.