Skip to content

Commit

Permalink
modifying it to be guard style
Browse files Browse the repository at this point in the history
  • Loading branch information
chirag-silabs committed Mar 27, 2024
1 parent cbc7e80 commit 1ff9e28
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/platform/silabs/NetworkCommissioningWiFiDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,19 +280,18 @@ void SlWiFiDriver::OnScanWiFiNetworkDone(wfx_wifi_scan_result_t * aScanResult)
{
if (mScanResponseIter.Count() == 0)
{
// if there is no network found, return kNetworkNotFound
DeviceLayer::SystemLayer().ScheduleLambda([]() {
GetInstance().mpScanCallback->OnFinished(NetworkCommissioning::Status::kNetworkNotFound, CharSpan(), nullptr);
GetInstance().mpScanCallback = nullptr;
});
return;
}
else
{
DeviceLayer::SystemLayer().ScheduleLambda([]() {
GetInstance().mpScanCallback->OnFinished(NetworkCommissioning::Status::kSuccess, CharSpan(),
&mScanResponseIter);
GetInstance().mpScanCallback = nullptr;
});
}
DeviceLayer::SystemLayer().ScheduleLambda([]() {
GetInstance().mpScanCallback->OnFinished(NetworkCommissioning::Status::kSuccess, CharSpan(),
&mScanResponseIter);
GetInstance().mpScanCallback = nullptr;
});
}
}
else
Expand Down

0 comments on commit 1ff9e28

Please sign in to comment.