From 73e6da92b298d48e3de9d775b5adc97cbff7b0aa Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Wed, 20 Mar 2002 10:25:52 +0000 Subject: [PATCH] avoid repeated call of g_spaced_primes_closest() by moving it out of the 2002-03-20 Sven Neumann * glib/ghash.c (g_hash_table_resize): avoid repeated call of g_spaced_primes_closest() by moving it out of the CLAMP macro (spotted by Salmaso Raffaele). --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-12 | 6 ++++++ ChangeLog.pre-2-2 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ glib/ghash.c | 6 +++--- 8 files changed, 45 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7829851..2fb3b6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-03-20 Sven Neumann + + * glib/ghash.c (g_hash_table_resize): avoid repeated call of + g_spaced_primes_closest() by moving it out of the CLAMP macro + (spotted by Salmaso Raffaele). + 2002-03-17 Tor Lillqvist * README.win32: Add MSVC-specific text by Hans Breuer. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 7829851..2fb3b6b 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2002-03-20 Sven Neumann + + * glib/ghash.c (g_hash_table_resize): avoid repeated call of + g_spaced_primes_closest() by moving it out of the CLAMP macro + (spotted by Salmaso Raffaele). + 2002-03-17 Tor Lillqvist * README.win32: Add MSVC-specific text by Hans Breuer. diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 7829851..2fb3b6b 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,9 @@ +2002-03-20 Sven Neumann + + * glib/ghash.c (g_hash_table_resize): avoid repeated call of + g_spaced_primes_closest() by moving it out of the CLAMP macro + (spotted by Salmaso Raffaele). + 2002-03-17 Tor Lillqvist * README.win32: Add MSVC-specific text by Hans Breuer. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 7829851..2fb3b6b 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +2002-03-20 Sven Neumann + + * glib/ghash.c (g_hash_table_resize): avoid repeated call of + g_spaced_primes_closest() by moving it out of the CLAMP macro + (spotted by Salmaso Raffaele). + 2002-03-17 Tor Lillqvist * README.win32: Add MSVC-specific text by Hans Breuer. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 7829851..2fb3b6b 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +2002-03-20 Sven Neumann + + * glib/ghash.c (g_hash_table_resize): avoid repeated call of + g_spaced_primes_closest() by moving it out of the CLAMP macro + (spotted by Salmaso Raffaele). + 2002-03-17 Tor Lillqvist * README.win32: Add MSVC-specific text by Hans Breuer. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 7829851..2fb3b6b 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +2002-03-20 Sven Neumann + + * glib/ghash.c (g_hash_table_resize): avoid repeated call of + g_spaced_primes_closest() by moving it out of the CLAMP macro + (spotted by Salmaso Raffaele). + 2002-03-17 Tor Lillqvist * README.win32: Add MSVC-specific text by Hans Breuer. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 7829851..2fb3b6b 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2002-03-20 Sven Neumann + + * glib/ghash.c (g_hash_table_resize): avoid repeated call of + g_spaced_primes_closest() by moving it out of the CLAMP macro + (spotted by Salmaso Raffaele). + 2002-03-17 Tor Lillqvist * README.win32: Add MSVC-specific text by Hans Breuer. diff --git a/glib/ghash.c b/glib/ghash.c index a91bcab..68cd812 100644 --- a/glib/ghash.c +++ b/glib/ghash.c @@ -585,9 +585,9 @@ g_hash_table_resize (GHashTable *hash_table) gint new_size; gint i; - new_size = CLAMP(g_spaced_primes_closest (hash_table->nnodes), - HASH_TABLE_MIN_SIZE, - HASH_TABLE_MAX_SIZE); + new_size = g_spaced_primes_closest (hash_table->nnodes); + new_size = CLAMP (new_size, HASH_TABLE_MIN_SIZE, HASH_TABLE_MAX_SIZE); + new_nodes = g_new0 (GHashNode*, new_size); for (i = 0; i < hash_table->size; i++) -- 2.7.4