std-aux: add nm_memeq() helper

This commit is contained in:
Thomas Haller 2022-07-27 10:47:11 +02:00
parent 60404836d8
commit 5c54bad89d
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -498,6 +498,12 @@ nm_memcmp(const void *s1, const void *s2, size_t n)
return memcmp(s1, s2, n);
}
static inline bool
nm_memeq(const void *s1, const void *s2, size_t len)
{
return nm_memcmp(s1, s2, len) == 0;
}
/*
* Very similar to g_str_has_prefix() with the obvious meaning.
* Differences: