Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill unused xbt_dict_dump().
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 2 Apr 2019 12:36:25 +0000 (14:36 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 2 Apr 2019 14:48:59 +0000 (16:48 +0200)
It's last usage was in ancient unit tests.

ChangeLog
include/xbt/dict.h
src/xbt/dict.cpp

index 0fa7201..725ee01 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 SimGrid (3.23) NOT RELEASED (Release Target: June 21. 2019, 15:54 UTC)
 
+XBT:
+ - Drop xbt_dict_dump.
+
 ----------------------------------------------------------------------------
 
 SimGrid (3.22) April 1. 2019
index 2ee6f60..589af4a 100644 (file)
@@ -79,7 +79,6 @@ XBT_PUBLIC xbt_dictelm_t xbt_dict_get_elm_or_null(xbt_dict_t dict, const char* k
 XBT_PUBLIC void xbt_dict_remove(xbt_dict_t dict, const char* key);
 XBT_PUBLIC void xbt_dict_reset(xbt_dict_t dict);
 XBT_PUBLIC int xbt_dict_length(xbt_dict_t dict);
-XBT_PUBLIC void xbt_dict_dump(xbt_dict_t dict, void (*output)(void*));
 XBT_PUBLIC int xbt_dict_is_empty(xbt_dict_t dict);
 
 /** @} */
index e15c41d..94be19e 100644 (file)
@@ -397,40 +397,6 @@ int xbt_dict_is_empty(xbt_dict_t dict)
   return not dict || (xbt_dict_length(dict) == 0);
 }
 
-/**
- * @brief Outputs the content of the structure (debugging purpose)
- *
- * @param dict the exibitionist
- * @param output a function to dump each data in the tree
- *
- * Outputs the content of the structure. (for debugging purpose).
- * @a output is a function to output the data. If nullptr, data won't be displayed.
- */
-void xbt_dict_dump(xbt_dict_t dict, void_f_pvoid_t output)
-{
-  xbt_dictelm_t element;
-  printf("Dict %p:\n", dict);
-  if (dict != nullptr) {
-    for (int i = 0; i < dict->table_size; i++) {
-      element = dict->table[i];
-      if (element) {
-        printf("[\n");
-        while (element != nullptr) {
-          printf(" %s -> '", element->key);
-          if (output != nullptr) {
-            output(element->content);
-          }
-          printf("'\n");
-          element = element->next;
-        }
-        printf("]\n");
-      } else {
-        printf("[]\n");
-      }
-    }
-  }
-}
-
 /**
  * Create the dict mallocators.
  * This is an internal XBT function called during the lib initialization.