diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index 570e13296..e58f0c347 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -1101,16 +1101,16 @@ int MleRouter::ComparePartitions(bool aSingletonA, { int rval = 0; - if (aSingletonA != aSingletonB) - { - ExitNow(rval = aSingletonB ? 1 : -1); - } - if (aLeaderDataA.GetWeighting() != aLeaderDataB.GetWeighting()) { ExitNow(rval = aLeaderDataA.GetWeighting() > aLeaderDataB.GetWeighting() ? 1 : -1); } + if (aSingletonA != aSingletonB) + { + ExitNow(rval = aSingletonB ? 1 : -1); + } + if (aLeaderDataA.GetPartitionId() != aLeaderDataB.GetPartitionId()) { ExitNow(rval = aLeaderDataA.GetPartitionId() > aLeaderDataB.GetPartitionId() ? 1 : -1);