diff --git a/gitg/gitg-repository.c b/gitg/gitg-repository.c index eb888161..ae83272b 100644 --- a/gitg/gitg-repository.c +++ b/gitg/gitg-repository.c @@ -376,20 +376,6 @@ gitg_repository_class_init(GitgRepositoryClass *klass) g_type_class_add_private(object_class, sizeof(GitgRepositoryPrivate)); } -static guint -hash_hash(gconstpointer v) -{ - /* 31 bit hash function, copied from g_str_hash */ - const signed char *p = v; - guint32 h = *p; - int i; - - for (i = 1; i < 20; ++i) - h = (h << 5) - h + p[i]; - - return h; -} - static void on_loader_update(GitgRunner *object, gchar **buffer, GitgRepository *self) { @@ -433,7 +419,7 @@ static void gitg_repository_init(GitgRepository *object) { object->priv = GITG_REPOSITORY_GET_PRIVATE(object); - object->priv->hashtable = g_hash_table_new_full(hash_hash, gitg_utils_hash_equal, NULL, NULL); + object->priv->hashtable = g_hash_table_new_full(gitg_utils_hash_hash, gitg_utils_hash_equal, NULL, NULL); object->priv->column_types[0] = GITG_TYPE_REVISION; object->priv->column_types[1] = G_TYPE_STRING; diff --git a/gitg/gitg-utils.c b/gitg/gitg-utils.c index c5f8ae93..7709b5f5 100644 --- a/gitg/gitg-utils.c +++ b/gitg/gitg-utils.c @@ -207,6 +207,20 @@ gitg_utils_convert_utf8(gchar const *str) return convert_fallback(str, "?"); } +guint +gitg_utils_hash_hash(gconstpointer v) +{ + /* 31 bit hash function, copied from g_str_hash */ + const signed char *p = v; + guint32 h = *p; + int i; + + for (i = 1; i < 20; ++i) + h = (h << 5) - h + p[i]; + + return h; +} + gboolean gitg_utils_hash_equal(gconstpointer a, gconstpointer b) { diff --git a/gitg/gitg-utils.h b/gitg/gitg-utils.h index 7d45df29..104e37c8 100644 --- a/gitg/gitg-utils.h +++ b/gitg/gitg-utils.h @@ -19,6 +19,7 @@ gchar const *todir, gchar * const *paths); gchar *gitg_utils_convert_utf8(gchar const *str); +guint gitg_utils_hash_hash(gconstpointer v); gboolean gitg_utils_hash_equal(gconstpointer a, gconstpointer b); gint gitg_utils_null_length(gconstpointer *ptr);