[glib: 2/4] Optional optimization for `g_int64_hash`
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 2/4] Optional optimization for `g_int64_hash`
- Date: Tue, 11 Oct 2022 11:26:42 +0000 (UTC)
commit c1af4b2b886bd77d6d8857cf3f677edbc0d34a61
Author: wszqkzqk <wszqkzqk qq com>
Date: Sat Oct 1 08:37:31 2022 +0800
Optional optimization for `g_int64_hash`
glib/ghash.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/ghash.c b/glib/ghash.c
index fc15428a83..6c95142074 100644
--- a/glib/ghash.c
+++ b/glib/ghash.c
@@ -2490,7 +2490,7 @@ g_int64_equal (gconstpointer v1,
guint
g_int64_hash (gconstpointer v)
{
- return (guint) *(const gint64*) v;
+ return (guint) ((const guint) (*(guint64 *) v >> 32)) ^ (*(const guint *) v);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]