[mle] simplify how parent candidate is cleared (#4525)

This commit inlines and removes `ResetParentCandidate()` method.
This commit is contained in:
Abtin Keshavarzian
2020-02-03 22:14:31 -08:00
committed by GitHub
parent 0d9f5cb58a
commit 3a25f3a020
2 changed files with 3 additions and 9 deletions
+3 -8
View File
@@ -637,7 +637,7 @@ otError Mle::BecomeChild(AttachMode aMode)
}
}
ResetParentCandidate();
mParentCandidate.Clear();
SetAttachState(kAttachStateStart);
mParentRequestMode = aMode;
@@ -1765,7 +1765,7 @@ void Mle::HandleAttachTimer(void)
case kAttachStateChildIdRequest:
SetAttachState(kAttachStateIdle);
ResetParentCandidate();
mParentCandidate.Clear();
delay = Reattach();
break;
}
@@ -3145,11 +3145,6 @@ exit:
return rval;
}
void Mle::ResetParentCandidate(void)
{
mParentCandidate.Clear();
}
otError Mle::HandleParentResponse(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo, uint32_t aKeySequence)
{
otError error = OT_ERROR_NONE;
@@ -3459,7 +3454,7 @@ otError Mle::HandleChildIdResponse(const Message & aMessage,
}
mParent = mParentCandidate;
ResetParentCandidate();
mParentCandidate.Clear();
mParent.SetRloc16(sourceAddress.GetRloc16());
-1
View File
@@ -1722,7 +1722,6 @@ private:
bool IsBetterParent(uint16_t aRloc16, uint8_t aLinkQuality, uint8_t aLinkMargin, ConnectivityTlv &aConnectivityTlv);
bool IsNetworkDataNewer(const LeaderDataTlv &aLeaderData);
void ResetParentCandidate(void);
otError GetAlocAddress(Ip6::Address &aAddress, uint16_t aAloc16) const;
#if OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE