From: Matthew Fernandez Date: Mon, 23 May 2022 14:39:23 +0000 (-0700) Subject: sparse: remove unused 'what_to_sum' from 'SparseMatrix_sum_repeat_entries' X-Git-Tag: 6.0.1~27^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70467830f9f0f7b67d9e2e24c59a095b4e9421b0;p=graphviz sparse: remove unused 'what_to_sum' from 'SparseMatrix_sum_repeat_entries' This function is never called with `what_to_sum` equal to `SUM_REPEATED_NONE`. --- diff --git a/lib/sparse/SparseMatrix.c b/lib/sparse/SparseMatrix.c index 730c3a7a5..054d11fac 100644 --- a/lib/sparse/SparseMatrix.c +++ b/lib/sparse/SparseMatrix.c @@ -851,7 +851,7 @@ static SparseMatrix SparseMatrix_from_coordinate_arrays_internal(int nz, int m, - if(sum_repeated) A = SparseMatrix_sum_repeat_entries(A, sum_repeated); + if(sum_repeated) A = SparseMatrix_sum_repeat_entries(A); return A; } @@ -1349,13 +1349,11 @@ SparseMatrix SparseMatrix_multiply3(SparseMatrix A, SparseMatrix B, SparseMatrix return D; } -SparseMatrix SparseMatrix_sum_repeat_entries(SparseMatrix A, int what_to_sum){ +SparseMatrix SparseMatrix_sum_repeat_entries(SparseMatrix A){ /* sum repeated entries in the same row, i.e., {1,1}->1, {1,1}->2 becomes {1,1}->3 */ int *ia = A->ia, *ja = A->ja, type = A->type, n = A->n; int *mask = NULL, nz = 0, i, j, sta; - if (what_to_sum == SUM_REPEATED_NONE) return A; - mask = MALLOC(sizeof(int)*((size_t)n)); for (i = 0; i < n; i++) mask[i] = -1; diff --git a/lib/sparse/SparseMatrix.h b/lib/sparse/SparseMatrix.h index 28d5ae1c9..7f97c0b27 100644 --- a/lib/sparse/SparseMatrix.h +++ b/lib/sparse/SparseMatrix.h @@ -67,7 +67,7 @@ SparseMatrix SparseMatrix_multiply(SparseMatrix A, SparseMatrix B); SparseMatrix SparseMatrix_multiply3(SparseMatrix A, SparseMatrix B, SparseMatrix C); enum {SUM_REPEATED_NONE = 0, SUM_REPEATED_ALL, }; -SparseMatrix SparseMatrix_sum_repeat_entries(SparseMatrix A, int what_to_sum); +SparseMatrix SparseMatrix_sum_repeat_entries(SparseMatrix A); SparseMatrix SparseMatrix_coordinate_form_add_entry(SparseMatrix A, int irn, int jcn, void *val); int SparseMatrix_is_symmetric(SparseMatrix A, bool test_pattern_symmetry_only);