Merge pull request #255 from OpenKNX/fix-check-init-of-assoc-table

Fix check init of assoc table
This commit is contained in:
thelsing 2023-08-09 10:25:32 +02:00 committed by GitHub
commit bf9c3ffab1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,6 +53,7 @@ void AssociationTableObject::prepareBinarySearch()
// we iterate through all ASAP
// the first n ASAP are sorted (strictly increasing number), these are assigning sending TSAP
// the remaining ASAP have to be all repetitions, otherwise we set sortedEntryCount to 0, which forces linear search
if(_tableData != nullptr) {
for (uint16_t idx = 0; idx < entryCount(); idx++)
{
currentASAP = getASAP(idx);
@ -89,6 +90,7 @@ void AssociationTableObject::prepareBinarySearch()
// in case complete table is strictly increasing
if (lookupIdx == 0 && sortedEntryCount == 0)
sortedEntryCount = entryCount();
}
#endif
}