Re: GHash small patch
- From: Sven Neumann <sven gimp org>
- To: gtk-devel-list gnome org
- Cc: Salmaso Raffaele <raffaele salmaso libero it>
- Subject: Re: GHash small patch
- Date: 20 Mar 2002 11:29:38 +0100
Hi,
> Salmaso Raffaele <raffaele salmaso libero it> writes:
>
> > A very little patch to avoid 3 function call when not needed.
> >
> > --- ghash.c Mon Dec 17 15:26:02 2001
> > +++ ghash-new.c Fri Mar 15 09:09:56 2002
> > @@ -585,9 +585,12 @@
> > 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);
> > + if (new_size < HASH_TABLE_MIN_SIZE)
> > + new_size = HASH_TABLE_MIN_SIZE;
> > + else if (new_size > HASH_TABLE_MAX_SIZE)
> > + new_size = HASH_TABLE_MAX_SIZE;
> > +
>
> You probably want
>
> new_size = g_spaced_primes_closest (hash_table->nnodes);
> new_size = CLAMP (new_size, HASH_TABLE_MIN_SIZE, HASH_TABLE_MAX_SIZE);
not that it would make much of a difference, but I've committed this
version to CVS before it gets forgotten.
Salut, Sven
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]