Eliminate redundant check in backwards_height
authorIvan Maidanski <ivmai@mail.ru>
Thu, 8 Nov 2018 22:05:51 +0000 (01:05 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 8 Nov 2018 22:05:51 +0000 (01:05 +0300)
This eliminates 'the condition pred!=NULL is redundant' cppcheck warning.

* backgraph.c [MAKE_BACK_GRAPH] (backwards_height): Remove duplicate
pred!=NULL check (the case of NULL is already handled by
"if(NULL==pred)return 1" statement).

backgraph.c

index 93b50b8..d43d170 100644 (file)
@@ -399,7 +399,7 @@ static word backwards_height(ptr_t p)
 
       if (((word)pred & FLAG_MANY) != 0) {
         n_edges = e -> n_edges;
-      } else if (pred != NULL && ((word)pred & 1) == 0) {
+      } else if (((word)pred & 1) == 0) {
         /* A misinterpreted freelist link.      */
         n_edges = 1;
         local = -1;