@@ -1521,12 +1521,12 @@ check_collation_set(Oid collid)
1521
1521
}
1522
1522
}
1523
1523
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.
1530
1530
*
1531
1531
* Note: many functions that depend on this are marked leakproof; therefore,
1532
1532
* 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)
1541
1541
1542
1542
check_collation_set (collid );
1543
1543
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
- */
1550
1544
if (lc_collate_is_c (collid ))
1551
1545
{
1552
1546
result = memcmp (arg1 , arg2 , Min (len1 , len2 ));
0 commit comments