[router-table] remove duplicate method (#8434)

This commit removes `RouterTable::GetActiveLinkCount()` and uses
`GetNeighborCount()` instead (which does the same).
This commit is contained in:
Abtin Keshavarzian
2022-11-22 18:21:13 -08:00
committed by GitHub
parent 2b579767ad
commit afcc48edde
3 changed files with 1 additions and 24 deletions
+1 -1
View File
@@ -1406,7 +1406,7 @@ Error MleRouter::HandleAdvertisement(RxInfo &aRxInfo)
VerifyOrExit(router != nullptr);
if (IsFullThreadDevice() && !router->IsStateValid() && !router->IsStateLinkRequest() &&
(mRouterTable.GetActiveLinkCount() < OPENTHREAD_CONFIG_MLE_CHILD_ROUTER_LINKS))
(mRouterTable.GetNeighborCount() < OPENTHREAD_CONFIG_MLE_CHILD_ROUTER_LINKS))
{
router->SetExtAddress(extAddr);
router->GetLinkInfo().Clear();
-15
View File
@@ -342,21 +342,6 @@ void RouterTable::RemoveRouterLink(Router &aRouter)
}
}
uint8_t RouterTable::GetActiveLinkCount(void) const
{
uint8_t activeLinks = 0;
for (const Router *router = GetFirstEntry(); router != nullptr; router = GetNextEntry(router))
{
if (router->IsStateValid())
{
activeLinks++;
}
}
return activeLinks;
}
const Router *RouterTable::FindRouter(const Router::AddressMatcher &aMatcher) const
{
const Router *router;
-8
View File
@@ -147,14 +147,6 @@ public:
*/
uint8_t GetActiveRouterCount(void) const { return mActiveRouterCount; }
/**
* This method returns the number of active links with neighboring routers.
*
* @returns The number of active links with neighboring routers.
*
*/
uint8_t GetActiveLinkCount(void) const;
/**
* This method returns the leader in the Thread network.
*