diff options
author | Jeff Davis <jdavis@postgresql.org> | 2024-08-21 09:19:21 -0700 |
---|---|---|
committer | Jeff Davis <jdavis@postgresql.org> | 2024-08-21 09:19:21 -0700 |
commit | a8395677840c37f6988d7d6420d551d0b744e6bd (patch) | |
tree | eb0a3dcde4576f851d3486f5796cab44adb953ba | |
parent | 86488cdf1249f86cff75c2446f670be49cb55055 (diff) | |
download | postgresql-a8395677840c37f6988d7d6420d551d0b744e6bd.tar.gz postgresql-a8395677840c37f6988d7d6420d551d0b744e6bd.zip |
Fix obsolete comments in varstr_cmp().
-rw-r--r-- | src/backend/utils/adt/varlena.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index f2ecef000a0..7c6391a2760 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -1521,12 +1521,12 @@ check_collation_set(Oid collid) } } -/* varstr_cmp() - * Comparison function for text strings with given lengths. - * Includes locale support, but must copy strings to temporary memory - * to allow null-termination for inputs to strcoll(). - * Returns an integer less than, equal to, or greater than zero, indicating - * whether arg1 is less than, equal to, or greater than arg2. +/* + * varstr_cmp() + * + * Comparison function for text strings with given lengths, using the + * appropriate locale. Returns an integer less than, equal to, or greater than + * zero, indicating whether arg1 is less than, equal to, or greater than arg2. * * Note: many functions that depend on this are marked leakproof; therefore, * avoid reporting the actual contents of the input when throwing errors. @@ -1541,12 +1541,6 @@ varstr_cmp(const char *arg1, int len1, const char *arg2, int len2, Oid collid) check_collation_set(collid); - /* - * Unfortunately, there is no strncoll(), so in the non-C locale case we - * have to do some memory copying. This turns out to be significantly - * slower, so we optimize the case where LC_COLLATE is C. We also try to - * optimize relatively-short strings by avoiding palloc/pfree overhead. - */ if (lc_collate_is_c(collid)) { result = memcmp(arg1, arg2, Min(len1, len2)); |