Skip to content

Commit a839567

Browse files
committed
Fix obsolete comments in varstr_cmp().
1 parent 86488cd commit a839567

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/backend/utils/adt/varlena.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,12 +1521,12 @@ check_collation_set(Oid collid)
15211521
}
15221522
}
15231523

1524-
/* varstr_cmp()
1525-
* Comparison function for text strings with given lengths.
1526-
* Includes locale support, but must copy strings to temporary memory
1527-
* to allow null-termination for inputs to strcoll().
1528-
* Returns an integer less than, equal to, or greater than zero, indicating
1529-
* whether arg1 is less than, equal to, or greater than arg2.
1524+
/*
1525+
* varstr_cmp()
1526+
*
1527+
* Comparison function for text strings with given lengths, using the
1528+
* appropriate locale. Returns an integer less than, equal to, or greater than
1529+
* zero, indicating whether arg1 is less than, equal to, or greater than arg2.
15301530
*
15311531
* Note: many functions that depend on this are marked leakproof; therefore,
15321532
* 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)
15411541

15421542
check_collation_set(collid);
15431543

1544-
/*
1545-
* Unfortunately, there is no strncoll(), so in the non-C locale case we
1546-
* have to do some memory copying. This turns out to be significantly
1547-
* slower, so we optimize the case where LC_COLLATE is C. We also try to
1548-
* optimize relatively-short strings by avoiding palloc/pfree overhead.
1549-
*/
15501544
if (lc_collate_is_c(collid))
15511545
{
15521546
result = memcmp(arg1, arg2, Min(len1, len2));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy