Simplified isInGroup test.

This commit is contained in:
hiker
2014-06-03 13:42:41 +10:00
parent 0d789c3bd2
commit 9a366f8ee1
2 changed files with 2 additions and 7 deletions

View File

@@ -209,11 +209,8 @@ core::stringw Track::getSortName() const
*/
bool Track::isInGroup(const std::string &group_name)
{
for(unsigned int i=0; i<m_groups.size(); i++)
{
if(m_groups[i]==group_name) return true;
}
return false;
return std::find(m_groups.begin(), m_groups.end(), group_name)
!= m_groups.end();
} // isInGroup
//-----------------------------------------------------------------------------

View File

@@ -433,9 +433,7 @@ public:
void itemCommand(const XMLNode *node);
core::stringw getName() const;
core::stringw getSortName() const;
// ------------------------------------------------------------------------
bool isInGroup(const std::string &group_name);
// ------------------------------------------------------------------------
const core::vector3df& getSunRotation();
/** Sets the current ambient color for a kart with index k. */
void setAmbientColor(const video::SColor &color,