]> granicus.if.org Git - graphviz/commitdiff
Correct assertion and remove 1 -Wparentheses warning in BinaryHeap.c
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sat, 7 Nov 2020 12:57:56 +0000 (13:57 +0100)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sat, 21 Nov 2020 08:12:33 +0000 (09:12 +0100)
Note the operator is changed from assigment to *inequality*. From the
surrounding code it's apparent that the intent was to check that no -1
values are left in the mask array (equality to 1 would also have been
correct).

lib/sparse/BinaryHeap.c

index 2720ace0977a2e9206497f40ca99308f5e174d04..4062e5a1c0890b05ce869002d0b4975b038d67cd 100644 (file)
@@ -266,7 +266,7 @@ void BinaryHeap_sanity_check(BinaryHeap h){
   }
 
   /* all IDs, spare or in use, are ccounted for and give a contiguous set */
-  for (i = 0; i < h->len + IntStack_get_length(h->id_stack); i++) assert(mask[i] =- 1);
+  for (i = 0; i < h->len + IntStack_get_length(h->id_stack); i++) assert(mask[i] != -1);
 
   FREE(mask);
 }