Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill global_routing->get_route_or_null
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 10 Nov 2011 17:05:39 +0000 (18:05 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 10 Nov 2011 17:44:53 +0000 (18:44 +0100)
It was used at only one location, so I setup a TRY/CATCH in there
instead

src/instr/instr_routing.c
src/surf/surf_private.h
src/surf/surf_routing.c

index 5164bfa..f63b722 100644 (file)
@@ -110,7 +110,13 @@ static void recursiveGraphExtraction (AS_t rc, container_t container, xbt_dict_t
           strcmp (child1_name, child2_name) != 0){
 
         xbt_dynar_t route = NULL;
-        route = global_routing->get_route_or_null (child1_name, child2_name);
+        xbt_ex_t e;
+
+        TRY {
+          route = routing_get_route(child1_name, child2_name);
+        } CATCH(e) {
+          xbt_ex_free(e);
+        }
         if (route == NULL) continue;
 
         if (TRACE_onelink_only()){
index 2963ec9..5162f68 100644 (file)
@@ -169,7 +169,6 @@ struct s_routing_global {
   AS_t root;
   void *loopback;
   size_t size_of_link;
-  xbt_dynar_t(*get_route_or_null) (const char *src, const char *dst);
   xbt_dynar_t(*get_route_no_cleanup) (const char *src, const char *dst);
   xbt_dynar_t(*get_onelink_routes) (void);
   double (*get_latency) (const char *src, const char *dst);
index cef2832..b63579d 100644 (file)
@@ -620,27 +620,6 @@ xbt_dynar_t routing_get_route(const char *src, const char *dst) {
   return route;
 }
 
-/**
- * \brief Generic method: find a route between hosts
- *
- * \param src the source host name
- * \param dst the destination host name
- *
- * same as get_route, but return NULL if any exception is raised.
- */
-static xbt_dynar_t get_route_or_null(const char *src, const char *dst)
-{
-  xbt_dynar_t route = NULL;
-  xbt_ex_t exception;
-  TRY {
-    get_route_latency(src, dst, &route, NULL, 1);
-  } CATCH(exception) {
-    xbt_ex_free(exception);
-    return NULL;
-  }
-  return route;
-}
-
 /**
  * \brief Generic method: find a route between hosts
  *
@@ -723,7 +702,6 @@ void routing_model_create(size_t size_of_links, void *loopback)
   /* config the uniq global routing */
   global_routing = xbt_new0(s_routing_global_t, 1);
   global_routing->root = NULL;
-  global_routing->get_route_or_null = get_route_or_null;
   global_routing->get_latency = get_latency;
   global_routing->get_route_no_cleanup = get_route_no_cleanup;
   global_routing->get_onelink_routes = get_onelink_routes;