[mle] simplify how parent candidate is cleared (#4525)
This commit inlines and removes `ResetParentCandidate()` method.
diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp
index fd3bd6c..715cf77 100644
--- a/src/core/thread/mle.cpp
+++ b/src/core/thread/mle.cpp
@@ -637,7 +637,7 @@
}
}
- ResetParentCandidate();
+ mParentCandidate.Clear();
SetAttachState(kAttachStateStart);
mParentRequestMode = aMode;
@@ -1765,7 +1765,7 @@
case kAttachStateChildIdRequest:
SetAttachState(kAttachStateIdle);
- ResetParentCandidate();
+ mParentCandidate.Clear();
delay = Reattach();
break;
}
@@ -3145,11 +3145,6 @@
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 @@
}
mParent = mParentCandidate;
- ResetParentCandidate();
+ mParentCandidate.Clear();
mParent.SetRloc16(sourceAddress.GetRloc16());
diff --git a/src/core/thread/mle.hpp b/src/core/thread/mle.hpp
index f59759e..5dc4323 100644
--- a/src/core/thread/mle.hpp
+++ b/src/core/thread/mle.hpp
@@ -1722,7 +1722,6 @@
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