From 1a5c6878103e436d0ac87c4c64c66ea6ad2fb435 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Sun, 12 Jan 2020 22:09:22 -0800 Subject: [PATCH] [mle] remove redundant call to RouterTable::GetRouter (#4465) --- src/core/thread/mle_router.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index 40c6c95a0..c5eb7b756 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -3447,7 +3447,7 @@ uint8_t MleRouter::GetCost(uint16_t aRloc16) VerifyOrExit(router != NULL && mRouterTable.GetRouter(router->GetNextHop()) != NULL); - routeCost = GetRouteCost(aRloc16) + GetLinkCost(mRouterTable.GetRouter(routerId)->GetNextHop()); + routeCost = GetRouteCost(aRloc16) + GetLinkCost(router->GetNextHop()); if (cost > routeCost) {