Finished testing new evList functionality

This commit is contained in:
Gregg 2024-06-08 17:46:49 -05:00
parent 983e159adf
commit 892c2247a3
1 changed files with 3 additions and 2 deletions

View File

@ -866,7 +866,7 @@ void Span::processSerialCommand(const char *c){
if(((*chr)->perms)&EV){ if(((*chr)->perms)&EV){
LOG0(", EV=("); LOG0(", EV=(");
boolean addComma=false; boolean addComma=false;
for(HAPClient *hc : (*chr)->evList){ for(auto const &hc : (*chr)->evList){
LOG0("%s%d",addComma?",":"",hc->clientNumber); LOG0("%s%d",addComma?",":"",hc->clientNumber);
addComma=true; addComma=true;
} }
@ -2319,7 +2319,8 @@ void SpanCharacteristic::EVLIST::add(HAPClient *hc){
/////////////////////////////// ///////////////////////////////
void SpanCharacteristic::EVLIST::remove(HAPClient *hc){ void SpanCharacteristic::EVLIST::remove(HAPClient *hc){
remove_if(begin(), end(), [hc](const HAPClient *hcTemp){return(hc==hcTemp);}); auto it=remove_if(begin(), end(), [hc](const HAPClient *hcTemp){return(hc==hcTemp);});
erase(it,end());
} }
/////////////////////////////// ///////////////////////////////