pgvector.git / summary / log / commit / refs
commit e6bd4c8acf389ce2667864e18efcebac3e954d01
Author: Andrew Kane <andrew@ankane.org>
Date: Tue Jul 28 05:09:33 2026 +0000
Improved CreateStateDatums [skip ci]
src/halfvec.c | 2 +-
src/vector.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/halfvec.c b/src/halfvec.c
index b1400dd8..17811006 100644
--- a/src/halfvec.c
+++ b/src/halfvec.c
@@ -32,7 +32,7 @@
#endif
#define STATE_DIMS(x) (ARR_DIMS(x)[0] - 1)
-#define CreateStateDatums(dim) palloc_array(Datum, (dim + 1))
+#define CreateStateDatums(dim) palloc_array(Datum, (dim) + 1)
/*
* Get a half from a message buffer
diff --git a/src/vector.c b/src/vector.c
index 09ecf9c6..dc133974 100644
--- a/src/vector.c
+++ b/src/vector.c
@@ -35,7 +35,7 @@
#endif
#define STATE_DIMS(x) (ARR_DIMS(x)[0] - 1)
-#define CreateStateDatums(dim) palloc_array(Datum, (dim + 1))
+#define CreateStateDatums(dim) palloc_array(Datum, (dim) + 1)
#if defined(USE_TARGET_CLONES) && !defined(__FMA__)
#define VECTOR_TARGET_CLONES __attribute__((target_clones("default", "fma")))
[parent: 1be6148eca80]