Small bit of refactoring.

This commit is contained in:
Jonathan Naylor 2017-07-10 19:38:47 +01:00
parent 52775c55ef
commit a2522f8f32

View file

@ -49,17 +49,10 @@ void CDMRAccessControl::init(const std::vector<unsigned int>& blacklist, const s
bool CDMRAccessControl::validateSrcId(unsigned int id)
{
if (m_selfOnly) {
if (m_id > 9999999) { // Check that the Config DMR-ID is bigger than 7 digits
if ((id == m_id/10) || (id == m_id/100)) { // does RF ID match Config ID / 10 or Config ID / 100
return true;
}
else {
return false;
}
}
else {
return id == m_id; // Origional Method
}
if (m_id > 9999999U) // Check that the Config DMR-ID is bigger than 7 digits
return (id == m_id / 10U) || (id == m_id / 100U); // Does RF ID match Config ID / 10 or Config ID / 100
else
return id == m_id;
}
if (std::find(m_blackList.begin(), m_blackList.end(), id) != m_blackList.end())