gateway: simplify and inline olsr_find_gateway_entry
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 19 Jul 2012 15:00:32 +0000 (17:00 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 25 Jul 2012 06:55:06 +0000 (08:55 +0200)
node2gateway already takes care of NULL

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/gateway.c

index 48b4fbe..04a4fc3 100644 (file)
@@ -131,11 +131,9 @@ olsr_trigger_inetgw_selection(bool ipv4, bool ipv6) {
  * @param originator
  * @return gateway_entry for corresponding router
  */
-static struct gateway_entry *
+static inline struct gateway_entry *
 olsr_find_gateway_entry(union olsr_ip_addr *originator) {
-  struct avl_node *node = avl_find(&gateway_tree, originator);
-
-  return node == NULL ? NULL : node2gateway(node);
+  return node2gateway(avl_find(&gateway_tree, originator));
 }
 
 static void cleanup_gateway_handler(void *ptr) {