mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Refactor to introduce pg_locale_deterministic().
Avoids the need of callers to test for NULL, and also avoids the need to access the pg_locale_t structure directly. Reviewed-by: Peter Eisentraut, Peter Geoghegan Discussion: https://postgr.es/m/a581136455c940d7bd0ff482d3a2bd51af25a94f.camel%40j-davis.com
This commit is contained in:
@ -1481,6 +1481,15 @@ report_newlocale_failure(const char *localename)
|
||||
}
|
||||
#endif /* HAVE_LOCALE_T */
|
||||
|
||||
bool
|
||||
pg_locale_deterministic(pg_locale_t locale)
|
||||
{
|
||||
/* default locale must always be deterministic */
|
||||
if (locale == NULL)
|
||||
return true;
|
||||
else
|
||||
return locale->deterministic;
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a locale_t from a collation OID. Results are cached for the
|
||||
|
Reference in New Issue
Block a user