diff options
author | Thomas Haller <thaller@redhat.com> | 2022-03-11 10:09:16 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2022-03-11 10:09:16 +0100 |
commit | 8fc40206ec37194624ab3d7a3327606f5d12d4fa (patch) | |
tree | 54b3aac076c2a6805c8fbaef423c35728c2bc6be | |
parent | 69376e20a533655682ed5ca30d35143f3028ad02 (diff) |
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.
-rw-r--r-- | src/core/nm-core-utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c index ab0c05ae01..e3ceb60fd8 100644 --- a/src/core/nm-core-utils.c +++ b/src/core/nm-core-utils.c @@ -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); \ |