Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and hicklin committed Aug 21, 2024
1 parent e71b084 commit 50da0c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ class RvcServiceAreaDelegate : public Delegate
// command support
bool IsSetSelectedAreasAllowed(MutableCharSpan & statusText) override;

bool IsValidSelectAreasSet(const Span<uint32_t> & selectedAreas,
ServiceArea::SelectAreasStatus & areaStatus, MutableCharSpan & statusText) override;
bool IsValidSelectAreasSet(const Span<uint32_t> & selectedAreas, ServiceArea::SelectAreasStatus & areaStatus,
MutableCharSpan & statusText) override;

bool HandleSkipArea(uint32_t skippedArea, MutableCharSpan & skipStatusText) override;

Expand Down
7 changes: 2 additions & 5 deletions src/app/clusters/service-area-server/service-area-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,24 +241,21 @@ void Instance::HandleSelectAreasCmd(HandlerContext & ctx, const Commands::Select
}

uint32_t selectedAreasBuffer[kMaxNumSelectedAreas];
auto selectedAreasSpan = Span<uint32_t>(selectedAreasBuffer, kMaxNumSelectedAreas);
auto selectedAreasSpan = Span<uint32_t>(selectedAreasBuffer, kMaxNumSelectedAreas);
uint32_t numberOfSelectedAreas = 0;

// Closure for checking if an area ID exists in the selectedAreasSpan
auto areaAlreadyExists = [&numberOfSelectedAreas, &selectedAreasSpan] (uint32_t areaId)
{
auto areaAlreadyExists = [&numberOfSelectedAreas, &selectedAreasSpan](uint32_t areaId) {
for (uint32_t i = 0; i < numberOfSelectedAreas; i++)
{
if (areaId == selectedAreasSpan[i])
{
return true;
}

}
return false;
};


// if number of selected locations in parameter matches number in attribute - the locations *might* be the same
bool matchesCurrentSelectedAreas = (numberOfAreas == mDelegate->GetNumberOfSelectedAreas());

Expand Down

0 comments on commit 50da0c2

Please sign in to comment.