summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Davis2024-08-20 21:29:34 +0000
committerJeff Davis2024-08-20 22:32:39 +0000
commita95ff1fe2eb4926b13e0940ad1f37d048704bdb0 (patch)
tree7d796916ccbeeadfe57ba62100e3925d38675958
parent15c1abd97710d74672e55d53148a0606baa91d18 (diff)
Slightly refactor varstr_sortsupport() to improve readability.
Author: Andreas Karlsson Discussion: https://postgr.es/m/[email protected]
-rw-r--r--src/backend/utils/adt/varlena.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c
index 4f9a676c93..973034548d 100644
--- a/src/backend/utils/adt/varlena.c
+++ b/src/backend/utils/adt/varlena.c
@@ -1917,25 +1917,25 @@ varstr_sortsupport(SortSupport ssup, Oid typid, Oid collid)
}
else
ssup->comparator = varlenafastcmp_locale;
- }
- /*
- * Unfortunately, it seems that abbreviation for non-C collations is
- * broken on many common platforms; see pg_strxfrm_enabled().
- *
- * Even apart from the risk of broken locales, it's possible that there
- * are platforms where the use of abbreviated keys should be disabled at
- * compile time. Having only 4 byte datums could make worst-case
- * performance drastically more likely, for example. Moreover, macOS's
- * strxfrm() implementation is known to not effectively concentrate a
- * significant amount of entropy from the original string in earlier
- * transformed blobs. It's possible that other supported platforms are
- * similarly encumbered. So, if we ever get past disabling this
- * categorically, we may still want or need to disable it for particular
- * platforms.
- */
- if (!collate_c && !pg_strxfrm_enabled(locale))
- abbreviate = false;
+ /*
+ * Unfortunately, it seems that abbreviation for non-C collations is
+ * broken on many common platforms; see pg_strxfrm_enabled().
+ *
+ * Even apart from the risk of broken locales, it's possible that there
+ * are platforms where the use of abbreviated keys should be disabled at
+ * compile time. Having only 4 byte datums could make worst-case
+ * performance drastically more likely, for example. Moreover, macOS's
+ * strxfrm() implementation is known to not effectively concentrate a
+ * significant amount of entropy from the original string in earlier
+ * transformed blobs. It's possible that other supported platforms are
+ * similarly encumbered. So, if we ever get past disabling this
+ * categorically, we may still want or need to disable it for particular
+ * platforms.
+ */
+ if (!pg_strxfrm_enabled(locale))
+ abbreviate = false;
+ }
/*
* If we're using abbreviated keys, or if we're using a locale-aware