avoid repeated call of g_spaced_primes_closest() by moving it out of the
authorSven Neumann <sven@gimp.org>
Wed, 20 Mar 2002 10:25:52 +0000 (10:25 +0000)
committerSven Neumann <neo@src.gnome.org>
Wed, 20 Mar 2002 10:25:52 +0000 (10:25 +0000)
2002-03-20  Sven Neumann  <sven@gimp.org>

* 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
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/ghash.c

index 7829851..2fb3b6b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-03-20  Sven Neumann  <sven@gimp.org>
+
+       * 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  <tml@iki.fi>
 
        * README.win32: Add MSVC-specific text by Hans Breuer.
index 7829851..2fb3b6b 100644 (file)
@@ -1,3 +1,9 @@
+2002-03-20  Sven Neumann  <sven@gimp.org>
+
+       * 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  <tml@iki.fi>
 
        * README.win32: Add MSVC-specific text by Hans Breuer.
index 7829851..2fb3b6b 100644 (file)
@@ -1,3 +1,9 @@
+2002-03-20  Sven Neumann  <sven@gimp.org>
+
+       * 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  <tml@iki.fi>
 
        * README.win32: Add MSVC-specific text by Hans Breuer.
index 7829851..2fb3b6b 100644 (file)
@@ -1,3 +1,9 @@
+2002-03-20  Sven Neumann  <sven@gimp.org>
+
+       * 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  <tml@iki.fi>
 
        * README.win32: Add MSVC-specific text by Hans Breuer.
index 7829851..2fb3b6b 100644 (file)
@@ -1,3 +1,9 @@
+2002-03-20  Sven Neumann  <sven@gimp.org>
+
+       * 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  <tml@iki.fi>
 
        * README.win32: Add MSVC-specific text by Hans Breuer.
index 7829851..2fb3b6b 100644 (file)
@@ -1,3 +1,9 @@
+2002-03-20  Sven Neumann  <sven@gimp.org>
+
+       * 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  <tml@iki.fi>
 
        * README.win32: Add MSVC-specific text by Hans Breuer.
index 7829851..2fb3b6b 100644 (file)
@@ -1,3 +1,9 @@
+2002-03-20  Sven Neumann  <sven@gimp.org>
+
+       * 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  <tml@iki.fi>
 
        * README.win32: Add MSVC-specific text by Hans Breuer.
index a91bcab..68cd812 100644 (file)
@@ -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++)