mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-24 16:00:07 +01:00
shared: add NM_HASH_COMBINE() function
This commit is contained in:
parent
b002357f5f
commit
489e346e87
1 changed files with 9 additions and 0 deletions
|
|
@ -381,6 +381,15 @@ _NM_IN_STRSET_streq (const char *x, const char *s)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
static inline guint
|
||||
NM_HASH_COMBINE (guint h, guint val)
|
||||
{
|
||||
/* see g_str_hash() for reasons */
|
||||
return (h << 5) + h + val;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* NM_CACHED_QUARK() returns the GQuark for @string, but caches
|
||||
* it in a static variable to speed up future lookups.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue