shared: add NM_HASH_COMBINE() function

This commit is contained in:
Thomas Haller
2017-06-20 10:19:37 +02:00
parent b002357f5f
commit 489e346e87

View File

@@ -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.
*