Skip to content

Commit

Permalink
Small bit of refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
g4klx committed Jul 10, 2017
1 parent 52775c5 commit a2522f8
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions DMRAccessControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit a2522f8

Please sign in to comment.