mirror of
https://github.com/espressif/openthread.git
synced 2026-09-06 09:10:04 +00:00
[child-table] enhance address iterator method (#6118)
Moving the if statement out of the loop always brings the same result.
This commit is contained in:
@@ -255,13 +255,13 @@ void Child::AddressIterator::Update(void)
|
||||
{
|
||||
const Ip6::Address *address;
|
||||
|
||||
if ((mIndex == 0) && (mChild.GetMeshLocalIp6Address(mMeshLocalAddress) != OT_ERROR_NONE))
|
||||
{
|
||||
mIndex++;
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
if ((mIndex == 0) && (mChild.GetMeshLocalIp6Address(mMeshLocalAddress) != OT_ERROR_NONE))
|
||||
{
|
||||
mIndex++;
|
||||
}
|
||||
|
||||
address = GetAddress();
|
||||
|
||||
VerifyOrExit((address != nullptr) && !address->IsUnspecified(), mIndex = kMaxIndex);
|
||||
|
||||
Reference in New Issue
Block a user