diff --git a/src/sparsevec.c b/src/sparsevec.c index b0c0055..f8444a0 100644 --- a/src/sparsevec.c +++ b/src/sparsevec.c @@ -887,6 +887,7 @@ sparsevec_l2_normalize(PG_FUNCTION_ARGS) zeros++; } + /* In the unlikely event there are zeros */ if (zeros > 0) { SparseVector *newResult = InitSparseVector(result->dim, result->nnz - zeros);