v3j-0002-Undo-perfect-hash-changes.patch
text/x-patch
Filename: v3j-0002-Undo-perfect-hash-changes.patch
Type: text/x-patch
Part: 1
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch 0002
Subject: Undo perfect hash changes.
| File | + | − |
|---|---|---|
| src/common/unicode_norm.c | 7 | 9 |
From 6d8ed31590b1920cae93929b67d9c0b41f4d075e Mon Sep 17 00:00:00 2001
From: Jeff Davis <jeff@j-davis.com>
Date: Fri, 8 Aug 2025 15:50:29 -0700
Subject: [PATCH v3j 2/4] Undo perfect hash changes.
---
src/common/unicode_norm.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/src/common/unicode_norm.c b/src/common/unicode_norm.c
index a3e51499e49..6654b4cbc49 100644
--- a/src/common/unicode_norm.c
+++ b/src/common/unicode_norm.c
@@ -18,10 +18,8 @@
#include "postgres_fe.h"
#endif
-#define NORMALIZE_PERFECTHASH
-
#include "common/unicode_norm.h"
-#ifdef NORMALIZE_PERFECTHASH
+#ifndef FRONTEND
#include "common/unicode_norm_hashfunc.h"
#include "common/unicode_normprops_table.h"
#include "port/pg_bswap.h"
@@ -48,7 +46,7 @@
#define NCOUNT VCOUNT * TCOUNT
#define SCOUNT LCOUNT * NCOUNT
-#ifndef NORMALIZE_PERFECTHASH
+#ifdef FRONTEND
/* comparison routine for bsearch() of decomposition lookup table. */
static int
conv_compare(const void *p1, const void *p2)
@@ -73,7 +71,7 @@ conv_compare(const void *p1, const void *p2)
static const pg_unicode_decomposition *
get_code_entry(pg_wchar code)
{
-#ifdef NORMALIZE_PERFECTHASH
+#ifndef FRONTEND
int h;
uint32 hashkey;
pg_unicode_decompinfo decompinfo = UnicodeDecompInfo;
@@ -256,7 +254,7 @@ recompose_code(uint32 start, uint32 code, uint32 *result)
* recomposed partially. This lookup uses a perfect hash function for
* the backend code.
*/
-#ifdef NORMALIZE_PERFECTHASH
+#ifndef FRONTEND
int h,
inv_lookup_index;
@@ -306,7 +304,7 @@ recompose_code(uint32 start, uint32 code, uint32 *result)
return true;
}
}
-#endif /* NORMALIZE_PERFECTHASH */
+#endif /* !FRONTEND */
}
return false;
@@ -539,7 +537,7 @@ unicode_normalize(UnicodeNormalizationForm form, const pg_wchar *input)
*/
/* We only need this in the backend. */
-#ifdef NORMALIZE_PERFECTHASH
+#ifndef FRONTEND
static const pg_unicode_normprops *
qc_hash_lookup(pg_wchar ch, const pg_unicode_norminfo *norminfo)
@@ -633,4 +631,4 @@ unicode_is_normalized_quickcheck(UnicodeNormalizationForm form, const pg_wchar *
return result;
}
-#endif /* NORMALIZE_PERFECTHASH */
+#endif /* !FRONTEND */
--
2.43.0