Use the STL find function instead of an iterator.

This commit is contained in:
Jonathan Naylor
2016-04-06 17:24:14 +01:00
parent 8d97e8f6f9
commit f7e2cff004
2 changed files with 7 additions and 20 deletions

View File

@@ -25,6 +25,7 @@
#include <cassert>
#include <ctime>
#include <algorithm>
unsigned int CDMRSlot::m_id = 0U;
unsigned int CDMRSlot::m_colorCode = 0U;
@@ -1265,12 +1266,7 @@ bool CDMRSlot::validateId(unsigned int id)
if (m_prefixes.size() == 0U)
return true;
for (std::vector<unsigned int>::const_iterator it = m_prefixes.begin(); it != m_prefixes.end(); ++it) {
if (prefix == *it)
return true;
}
return false;
return std::find(m_prefixes.begin(), m_prefixes.end(), prefix) != m_prefixes.end();
}
}