mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-18 03:50:48 +02:00
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:
parent
69376e20a5
commit
8fc40206ec
1 changed files with 1 additions and 1 deletions
|
|
@ -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); \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue