core: use NM_STR_HAS_PREFIX() in nm_utils_stable_id_parse()

NM_STR_HAS_PREFIX() expands to one `strncpy()`, with the length being a
compile time constant. It's faster than calling through glib.
This commit is contained in:
Thomas Haller 2022-03-11 10:09:16 +01:00
parent 69376e20a5
commit 8fc40206ec
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -3421,7 +3421,7 @@ nm_utils_stable_id_parse(const char *stable_id,
({ \
gboolean _match = FALSE; \
\
if (g_str_has_prefix(&stable_id[i], "" prefix "")) { \
if (NM_STR_HAS_PREFIX(&stable_id[i], "" prefix "")) { \
_match = TRUE; \
if (!str) \
str = g_string_sized_new(256); \