From f1ac94e415620b3281a69df1ec79d7a169e68b81 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Sun, 13 Feb 2011 14:14:49 +0100 Subject: [PATCH] Slight code complexity reduction --- core/net/rpl/rpl-of-etx.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/net/rpl/rpl-of-etx.c b/core/net/rpl/rpl-of-etx.c index c4ac3e6da..82e7a2bde 100644 --- a/core/net/rpl/rpl-of-etx.c +++ b/core/net/rpl/rpl-of-etx.c @@ -161,11 +161,7 @@ best_parent(rpl_parent_t *p1, rpl_parent_t *p2) p2_rank - MAX_DIFFERENCE(dag), p1_rank, p2_rank + MAX_DIFFERENCE(dag)); - if(p1 == dag->preferred_parent) { - return p1; - } else if(p2 == dag->preferred_parent) { - return p2; - } + return dag->preferred_parent; } if(p1_rank < p2_rank) {