dns: use NM_STR_HAS_SUFFIX() instead of g_str_has_suffix()

It translates to a plain memcmp() as the argument is a string literal.
This commit is contained in:
Thomas Haller 2023-05-02 11:35:07 +02:00
parent b4338de984
commit 601605dbea
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -2128,7 +2128,8 @@ nm_dns_manager_set_hostname(NMDnsManager *self, const char *hostname, gboolean s
/* Certain hostnames we don't want to include in resolv.conf 'searches' */
if (hostname && nm_utils_is_specific_hostname(hostname)
&& !g_str_has_suffix(hostname, ".in-addr.arpa") && !nm_inet_is_valid(AF_UNSPEC, hostname)) {
&& !NM_STR_HAS_SUFFIX(hostname, ".in-addr.arpa")
&& !nm_inet_is_valid(AF_UNSPEC, hostname)) {
domain = strchr(hostname, '.');
if (domain) {
domain++;