Remove unnecessary check for NULL locale, per Coverity.
authorJeff Davis
Mon, 12 Aug 2024 19:26:23 +0000 (12:26 -0700)
committerJeff Davis
Mon, 12 Aug 2024 19:26:23 +0000 (12:26 -0700)
Discussion: https://postgr.es/m/3804933.1723394010@sss.pgh.pa.us
Reported-by: Tom Lane
src/backend/utils/adt/like.c

index bb4d73fb22e74fbca6a2b51264ba557ac31ad7ef..131616fa6b8d2805ea7a1ebf4be7c0cbf0520b7c 100644 (file)
@@ -201,7 +201,7 @@ Generic_Text_IC_like(text *str, text *pat, Oid collation)
     * way.
     */
 
-   if (pg_database_encoding_max_length() > 1 || (locale && locale->provider == COLLPROVIDER_ICU))
+   if (pg_database_encoding_max_length() > 1 || (locale->provider == COLLPROVIDER_ICU))
    {
        pat = DatumGetTextPP(DirectFunctionCall1Coll(lower, collation,
                                                     PointerGetDatum(pat)));