list_is_valid(): Remove '#if 1' block around the function body
authorFabian Keil <fk@fabiankeil.de>
Thu, 4 Feb 2021 18:05:35 +0000 (19:05 +0100)
committerFabian Keil <fk@fabiankeil.de>
Sun, 21 Feb 2021 15:09:20 +0000 (16:09 +0100)
The function can be disabled by compiling with NDEBUG now.

list.c

diff --git a/list.c b/list.c
index fe9c41e..a2d7ff6 100644 (file)
--- a/list.c
+++ b/list.c
@@ -144,11 +144,6 @@ void destroy_list (struct list *the_list)
  *********************************************************************/
 static int list_is_valid (const struct list *the_list)
 {
-   /*
-    * If you don't want this check, just change the line below
-    * from "#if 1" to "#if 0".
-    */
-#if 1
    const struct list_entry *cur_entry;
    const struct list_entry *last_entry = NULL;
    int entry = 0;
@@ -201,9 +196,7 @@ static int list_is_valid (const struct list *the_list)
    }
 
    return (the_list->last == last_entry);
-#else
-   return 1;
-#endif
+
 }
 #endif /* ndef NDEBUG */