From d5dfa560eac6ff66b580580383fbcb636b2e15bc Mon Sep 17 00:00:00 2001
From: John Naylor <john.naylor@postgresql.org>
Date: Sat, 9 Dec 2023 16:22:35 +0700
Subject: [PATCH v7 04/13] Assert that the incremental fasthash variants give
 the same answer as the original

XXX: Remove this and also the *_orig functions before commit
---
 src/common/hashfn.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/common/hashfn.c b/src/common/hashfn.c
index 2490607eea..37c8d307c7 100644
--- a/src/common/hashfn.c
+++ b/src/common/hashfn.c
@@ -26,6 +26,7 @@
 #include "common/hashfn.h"
 #include "port/pg_bitutils.h"
 
+#include "common/hashfn_unstable.h"
 
 /*
  * This hash function was written by Bob Jenkins
@@ -150,6 +151,9 @@ hash_bytes(const unsigned char *k, int keylen)
 				c,
 				len;
 
+	// XXX not for commit
+	Assert(fasthash64_orig((void *) k, keylen, 0) == fasthash64(k, keylen, 0));
+
 	/* Set up the internal state */
 	len = keylen;
 	a = b = c = 0x9e3779b9 + len + 3923095;
-- 
2.43.0

