diff --git a/src/vector.c b/src/vector.c index 64b247d..15711f8 100644 --- a/src/vector.c +++ b/src/vector.c @@ -1190,9 +1190,9 @@ hamming_distance(PG_FUNCTION_ARGS) CheckBitLengths(VARBITLEN(a), VARBITLEN(b)); + /* TODO Improve performance */ for (uint32 i = 0; i < VARBITBYTES(a); i++) distance += pg_number_of_ones[ax[i] ^ bx[i]]; - /* TODO Decide on return type */ PG_RETURN_FLOAT8((double) distance); }