diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-06-12 20:51:41 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-06-29 15:41:51 +0200 |
commit | d0aec7d4daa0670411613de4e9c3cd444a8a216f (patch) | |
tree | e8f68ae89a236423a368130a4c08edbbbd4a10bc | |
parent | Merge pull request #23827 from yuwata/sd-event-process-buffered-inotify-data (diff) | |
download | systemd-d0aec7d4daa0670411613de4e9c3cd444a8a216f.tar.xz systemd-d0aec7d4daa0670411613de4e9c3cd444a8a216f.zip |
sd-id128: avoid an unnecessary function call in inline helper
When optimizing, the compiler will most likely replace the call to memcmp(),
but at -O0, the code that is emitted builds the call preamble and does the
call. Let's use the same pattern as with sd_id128_is_null() and
sd_id128_is_allf() and avoid the call.
-rw-r--r-- | src/systemd/sd-id128.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/systemd/sd-id128.h b/src/systemd/sd-id128.h index f7d3244bb3..2aa41623ce 100644 --- a/src/systemd/sd-id128.h +++ b/src/systemd/sd-id128.h @@ -116,7 +116,7 @@ int sd_id128_get_boot_app_specific(sd_id128_t app_id, sd_id128_t *ret); #a #b #c #d "-" #e #f "-" #g #h "-" #i #j "-" #k #l #m #n #o #p _sd_pure_ static __inline__ int sd_id128_equal(sd_id128_t a, sd_id128_t b) { - return memcmp(&a, &b, 16) == 0; + return a.qwords[0] == b.qwords[0] && a.qwords[1] == b.qwords[1]; } _sd_pure_ static __inline__ int sd_id128_is_null(sd_id128_t a) { |