]> granicus.if.org Git - graphviz/commitdiff
Agglomerative_Ink_Bundling_establish: remove unused 'mask'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 15 Jan 2022 21:32:45 +0000 (13:32 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 16 Jan 2022 18:51:42 +0000 (10:51 -0800)
It is unclear to me what the purpose of this local was intended to be.
Furthermore it was being mis-allocated as if it were an array of doubles, not
ints.

lib/mingle/agglomerative_bundling.cpp

index bee4d27151a417c62f0cf9f4824a21f612acbaa4..93c8b6c91f542552834706cc26e7cb1ea44ab592 100644 (file)
@@ -86,7 +86,6 @@ static Agglomerative_Ink_Bundling Agglomerative_Ink_Bundling_establish(Agglomera
   int n = grid->n, level = grid->level, nc = 0;
   int *ia = A->ia, *ja = A->ja;
   int i, j, k, jj, jc, jmax, ni, nj, npicks;
-  int *mask;
   pedge *edges = grid->edges;
   double *inks = grid->inks, *cinks, inki, inkj;
   double gain, maxgain, minink, total_gain = 0;
@@ -105,9 +104,6 @@ static Agglomerative_Ink_Bundling Agglomerative_Ink_Bundling_establish(Agglomera
     jp = grid->R0->ja;
   }
 
-  mask = (int*)MALLOC(sizeof(double)*n);
-  for (i = 0; i < n; i++) mask[i] = -1;
-
   assert(n == A->n);
   std::vector<int> matching(n, UNMATCHED);
 
@@ -285,7 +281,6 @@ static Agglomerative_Ink_Bundling Agglomerative_Ink_Bundling_establish(Agglomera
   }
 
  RETURN:
-  free(mask);
   return grid;
 }