diff --git a/src/core/thread/router_table.cpp b/src/core/thread/router_table.cpp index 32d7d8713..4e3499d41 100644 --- a/src/core/thread/router_table.cpp +++ b/src/core/thread/router_table.cpp @@ -395,24 +395,6 @@ exit: return router; } -Router *RouterTable::GetRouter(uint8_t aRouterId) -{ - Router * rval = NULL; - uint16_t rloc16 = Mle::Mle::GetRloc16(aRouterId); - - for (uint8_t i = 0; i < Mle::kMaxRouters; i++) - { - if (mRouters[i].GetRloc16() == rloc16) - { - rval = &mRouters[i]; - ExitNow(); - } - } - -exit: - return rval; -} - const Router *RouterTable::GetRouter(uint8_t aRouterId) const { const Router *rval = NULL; diff --git a/src/core/thread/router_table.hpp b/src/core/thread/router_table.hpp index d1aa74f39..7e63973af 100644 --- a/src/core/thread/router_table.hpp +++ b/src/core/thread/router_table.hpp @@ -238,7 +238,10 @@ public: * @returns A pointer to the router or NULL if the router could not be found. * */ - Router *GetRouter(uint8_t aRouterId); + Router *GetRouter(uint8_t aRouterId) + { + return const_cast(const_cast(this)->GetRouter(aRouterId)); + } /** * This method returns the router for a given router id.