diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-03-24 17:08:09 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-03-28 16:01:58 +0200 |
commit | 3f8e42c03828ff2da0392111b394fac6f5d3c3da (patch) | |
tree | 5922e83efd2a3500d5ecfc5a7eb17b8d343eb513 /src/shared/bootspec.h | |
parent | d412691a91fc29e2a8204fe4b3494426fbb76cac (diff) | |
download | systemd-3f8e42c03828ff2da0392111b394fac6f5d3c3da.tar.gz |
bootspec: don't needlessly inline boot_config_find_entry()
the function contains a loop and if expressions and whatnot. Let's
define it as regular function, to make the header easier to read and let
the compiler more freedom on whether to inline this or not.
Diffstat (limited to 'src/shared/bootspec.h')
-rw-r--r-- | src/shared/bootspec.h | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/shared/bootspec.h b/src/shared/bootspec.h index 0f199d5ee9..02ccd90aee 100644 --- a/src/shared/bootspec.h +++ b/src/shared/bootspec.h @@ -69,17 +69,7 @@ typedef struct BootConfig { .selected_entry = -1, \ } -static inline BootEntry* boot_config_find_entry(BootConfig *config, const char *id) { - assert(config); - assert(id); - - for (size_t j = 0; j < config->n_entries; j++) - if (streq_ptr(config->entries[j].id, id) || - streq_ptr(config->entries[j].id_old, id)) - return config->entries + j; - - return NULL; -} +BootEntry* boot_config_find_entry(BootConfig *config, const char *id); static inline BootEntry* boot_config_default_entry(BootConfig *config) { assert(config); |