X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Fcovariance-matrix.c;h=c419ce02e8b2357a868526aff9147f172b1125d7;hb=991f3d8dbedb0c1ceb87207229f606f3d1d17e5d;hp=88b85051d87eb96d0547993db351b6a633788190;hpb=fc6ad15503e6318bfe92c29c884f7350947e21c1;p=pspp-builds.git diff --git a/src/math/covariance-matrix.c b/src/math/covariance-matrix.c index 88b85051..c419ce02 100644 --- a/src/math/covariance-matrix.c +++ b/src/math/covariance-matrix.c @@ -350,15 +350,10 @@ covariance_accumulator_hash (const void *h, const void *aux) } if (var_is_alpha (v_max) && var_is_alpha (v_min)) { - unsigned int tmp; - char *x = - xnmalloc (1 + var_get_width (v_max) + var_get_width (v_min), - sizeof (*x)); - strncpy (x, val_max->s, var_get_width (v_max)); - strncat (x, val_min->s, var_get_width (v_min)); - tmp = *n_vars * (*n_vars + 1 + idx_max) + idx_min + hsh_hash_string (x); - free (x); - return tmp; + unsigned tmp = hsh_hash_bytes (val_max, var_get_width (v_max)); + tmp ^= hsh_hash_bytes (val_min, var_get_width (v_min)); + tmp += *n_vars * (*n_vars + 1 + idx_max) + idx_min; + return (size_t) tmp; } return -1u; }