diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd6d988..1afa730 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,23 +79,3 @@ jobs: shell: cmd - if: ${{ failure() }} run: cat regression.diffs - i386: - runs-on: ubuntu-latest - container: - image: debian:11 - options: --platform linux/386 - steps: - - run: apt-get update && apt-get install -y build-essential git libipc-run-perl postgresql-13 postgresql-server-dev-13 sudo - - run: service postgresql start - - run: | - git clone https://github.com/${{ github.repository }}.git pgvector - cd pgvector - git fetch origin ${{ github.ref }} - git reset --hard FETCH_HEAD - make - make install - chown -R postgres . - sudo -u postgres make installcheck - sudo -u postgres make prove_installcheck - env: - PG_CFLAGS: -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare diff --git a/src/vector.c b/src/vector.c index f6c5abc..49d33d1 100644 --- a/src/vector.c +++ b/src/vector.c @@ -755,7 +755,6 @@ normalize_l2(PG_FUNCTION_ARGS) Vector *a = PG_GETARG_VECTOR_P(0); float *ax = a->x; double norm = 0.0; - float normf; Vector *result; float *rx; @@ -767,13 +766,12 @@ normalize_l2(PG_FUNCTION_ARGS) norm += (double) ax[i] * (double) ax[i]; norm = sqrt(norm); - normf = (float) norm; - if (normf > 0) + if (norm > 0) { /* Auto-vectorized */ for (int i = 0, imax = a->dim; i < imax; i++) - rx[i] = ax[i] / normf; + rx[i] = ax[i] / norm; /* Check for overflow */ for (int i = 0, imax = a->dim; i < imax; i++)